Project

General

Profile

Actions

Bug #23377

closed

RemoveXSS exposes XSS vulnerability for double encoded characters

Added by Marcus Krause over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
-
Start date:
2010-08-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

One feature/task of RemoveXSS is the decoding of Unicode numerical/hex encoded characters. This kind of normalization is done before RemoveXSS searches for potential malicious strings.

The here reported vulnerability uses this feature to circumvent the XSS detection. It uses a double encoded character. Outputting such string normally would not be a XSS problem as browsers won't render XSS strings for such double encoded characters. However, together with RemoveXSS it becomes a problem. A double encoded character becomes malicious after passing the RemoveXSS check.

The solution is to do the decoding within a loop. Looping is done as long as regex patterns match encoded characters.

Please use the attached unit tests! Some tests will fail for double encoded chacters with the current TYPO3 Core implementation. After applying the RemoveXSS patch all tests should pass.

OTRS-X-Reference: #2010072910000039
Reporter: Franz G. Jahn (cron IT)

Initial mitigation patch provided by reporter.

To be committed:
  • additional unit tests regarding encoded characters
  • RemoveXSS patch
    (issue imported from #M15461)

Files

15461_4-3_phpunit.diff (1.66 KB) 15461_4-3_phpunit.diff Administrator Admin, 2010-08-15 23:20
15461_4-3.diff (3.5 KB) 15461_4-3.diff Administrator Admin, 2010-08-15 23:20
15461_4-2.diff (3.5 KB) 15461_4-2.diff Administrator Admin, 2010-08-15 23:30
15461_4-4.diff (3.5 KB) 15461_4-4.diff Administrator Admin, 2010-08-15 23:53
15461_4-4_phpunit.diff (1.65 KB) 15461_4-4_phpunit.diff Administrator Admin, 2010-08-16 00:00
15461_trunk_phpunit.diff (1.65 KB) 15461_trunk_phpunit.diff Administrator Admin, 2010-08-16 00:17
15461_trunk.diff (3.5 KB) 15461_trunk.diff Administrator Admin, 2010-08-16 00:18
15461-tests-v2.diff (1.51 KB) 15461-tests-v2.diff Administrator Admin, 2010-10-04 21:59
Actions #1

Updated by Thorsten Kahler about 14 years ago

+1 on reading and testing for 4.3 and 4.4
+1 on reading for 4.2

Actions #2

Updated by Thomas Hempel about 14 years ago

+1 for trunk, version 4.3 and 4.4 on reading testing
+1 for version 4.2 on reading after checking 4.3 and 4.4

Actions #3

Updated by Marcus Krause about 14 years ago

Thanks for reviewing!

Actions #4

Updated by Thorsten Kahler about 14 years ago

+1 on reading and testing for trunk version

Actions

Also available in: Atom PDF