This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from yahoo/enhance-css-filters-for-IE
Enhance css filters for IE
- Loading branch information
Showing
2 changed files
with
68 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,23 +316,29 @@ Authors: Nera Liu <[email protected]> | |
'\uD7FF', '\uD800', '\uDFFF', '\u1234567', | ||
'\u0000', ' ', '\r\n\t\f\v', '\\', '\\n\\r\\f\\0\\9\\a\\f', | ||
'-ide_nt', '"string"', "'string'", | ||
'- \ _ : ; ( ) " \' / , % # ! * @ . { }', | ||
'- \ _ : ; ( ) " \' / , % # ! * @ . { } []', | ||
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'url(https://www.evil.com)', | ||
'u\x00\x00rl(https://www.evil.com)', | ||
'\\u\\r\x00\x00\\l\x00\\((evil.com))', | ||
'expression(body.scrollTop + 50 + px)', | ||
'(((()))) \\28 \\29' | ||
]; | ||
|
||
it('filter yceu[uds] test', function() { | ||
var expectedResults = [ 'undefined', 'null', | ||
'\\26 ', | ||
';-x:\'&\';-v:', | ||
'1.1', '10%', '+10px', '-10px', '#fff', | ||
'\\d7ff ', '\\d800 ', '\\dfff ', '\\1234 567', | ||
'\\fffd ', '\\20 ', '\\d \\a \\9 \\c \\b ', '\\5c ', '\\5c n\\5c r\\5c f\\5c 0\\5c 9\\5c a\\5c f', | ||
'-ide_nt', '\\22 string\\22 ', "\\27 string\\27 ", | ||
'-\\20 \\20 _\\20 \\3a \\20 \\3b \\20 \\28 \\20 \\29 \\20 \\22 \\20 \\27 \\20 \\2f \\20 \\2c \\20 %\\20 #\\20 \\21 \\20 \\2a \\20 \\40 \\20 .\\20 \\7b \\20 \\7d ', | ||
'http\\3a \\2f \\2f username\\3a password\\40 www.evil.com\\3a 8080\\2f \\3f k1\\3d v1\\26 k2\\3d v2#hash', | ||
'url\\28 https\\3a \\2f \\2f www.evil.com\\29 ', | ||
'expression\\28 body.scrollTop\\20 +\\20 50\\20 +\\20 px\\29 ', | ||
';-x:\'\uD7FF\';-v:', ';-x:\'\uD800\';-v:', ';-x:\'\uDFFF\';-v:', ';-x:\'\u1234567\';-v:', | ||
';-x:\'\uFFFD\';-v:', ';-x:\' \';-v:', ';-x:\'\\d \\a \\9 \\c \\b \';-v:', ';-x:\'\\5c \';-v:', ';-x:\'\\5c n\\5c r\\5c f\\5c 0\\5c 9\\5c a\\5c f\';-v:', | ||
'-ide_nt', ';-x:\'"string"\';-v:', ';-x:\'\\27 string\\27 \';-v:', | ||
';-x:\'- _ : ; ( ) " \\27 / , % # ! * @ . \\7b \\7d \\5b \\5d \';-v:', | ||
';-x:\'http://username:[email protected]:8080/?k1=v1&k2=v2#hash\';-v:', | ||
';-x:\'-x-url(https://www.evil.com)\';-v:', | ||
';-x:\'u\ufffd\ufffdrl(https://www.evil.com)\';-v:', | ||
';-x:\'\\5c u\\5c r\ufffd\ufffd\\5c l\ufffd\\5c ((evil.com))\';-v:', | ||
';-x:\'expression(body.scrollTop + 50 + px)\';-v:', | ||
';-x:\'(((()))) \\5c 28 \\5c 29\';-v:' | ||
]; | ||
testutils.test_yce(filter.yceu, testPatterns, expectedResults); | ||
}); | ||
|
@@ -343,10 +349,13 @@ Authors: Nera Liu <[email protected]> | |
'\uD7FF', '\uD800', '\uDFFF', '\u1234567', | ||
'\uFFFD', ' ', '\\d \\a \\9 \\c \\b ', '\\5c ', '\\5c n\\5c r\\5c f\\5c 0\\5c 9\\5c a\\5c f', | ||
'-ide_nt', '\\22 string\\22 ', "'string'", | ||
'- _ : ; ( ) \\22 \' / , % # ! * @ . { }', | ||
'- _ : ; ( ) \\22 \' / , % # ! * @ . \\7b \\7d \\5b \\5d ', | ||
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'url(https://www.evil.com)', | ||
'-x-url(https://www.evil.com)', | ||
'u\ufffd\ufffdrl(https://www.evil.com)', | ||
'\\5c u\\5c r\ufffd\ufffd\\5c l\ufffd\\5c ((evil.com))', | ||
'expression(body.scrollTop + 50 + px)', | ||
'(((()))) \\5c 28 \\5c 29', | ||
]; | ||
testutils.test_yce(filter.yced, testPatterns, expectedResults); | ||
}); | ||
|
@@ -357,16 +366,18 @@ Authors: Nera Liu <[email protected]> | |
'\uD7FF', '\uD800', '\uDFFF', '\u1234567', | ||
'\uFFFD', ' ', '\\d \\a \\9 \\c \\b ', '\\5c ', '\\5c n\\5c r\\5c f\\5c 0\\5c 9\\5c a\\5c f', | ||
'-ide_nt', '"string"', "\\27 string\\27 ", | ||
'- _ : ; ( ) " \\27 / , % # ! * @ . { }', | ||
'- _ : ; ( ) " \\27 / , % # ! * @ . \\7b \\7d \\5b \\5d ', | ||
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'url(https://www.evil.com)', | ||
'-x-url(https://www.evil.com)', | ||
'u\ufffd\ufffdrl(https://www.evil.com)', | ||
'\\5c u\\5c r\ufffd\ufffd\\5c l\ufffd\\5c ((evil.com))', | ||
'expression(body.scrollTop + 50 + px)', | ||
'(((()))) \\5c 28 \\5c 29', | ||
]; | ||
testutils.test_yce(filter.yces, testPatterns, expectedResults); | ||
}); | ||
}); | ||
|
||
|
||
describe("private-xss-filters: css url tests", function() { | ||
var testPatterns = [ undefined, null, | ||
'&', | ||
|
@@ -378,7 +389,8 @@ Authors: Nera Liu <[email protected]> | |
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'\u0000\u0008\u000b\u007f\u000e-\u001f', | ||
')))((('''""""', | ||
'javascript:alert(1)' | ||
'javascript:alert(1)', | ||
'(((()))) \\28 \\29', | ||
]; | ||
|
||
it('filter yceuu[uds] attribute test', function() { | ||
|
@@ -388,11 +400,12 @@ Authors: Nera Liu <[email protected]> | |
'%5Ca', '%ED%9F%BF', '%E1%88%B4567', | ||
'%EF%BF%BD', '%20', '%0D%0A%09%0C%0B', '%5C', '%5Cn%5Cr%5Cf%5C0%5C9%5Ca%5Cf', | ||
'-ide_nt', '%22string%22', "\\27 string\\27 ", | ||
'-%20%20_%20:%20;%20\\28 %20\\29 %20%22%20\\27 %20/%20,%20%25%20#%20!%20*%20@%20.%20%7B%20%7D%20%5B%20%5D', | ||
'-%20%20_%20:%20;%20%28%20%29%20%22%20\\27 %20/%20,%20%25%20#%20!%20*%20@%20.%20%7B%20%7D%20%5B%20%5D', | ||
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'%EF%BF%BD%08%0B%7F%0E-%1F', | ||
'\\29 \\29 \\29 \\28 \\28 \\28 \\27 \\27 \\27 %22%22%22%22', | ||
'##javascript:alert\\28 1\\29 ' | ||
'%29%29%29%28%28%28\\27 \\27 \\27 %22%22%22%22', | ||
'##javascript:alert%281%29', | ||
'%28%28%28%28%29%29%29%29%20%5C28%20%5C29', | ||
]; | ||
testutils.test_yce(filter.yceuu, testPatterns, expectedResults); | ||
}); | ||
|
@@ -407,7 +420,8 @@ Authors: Nera Liu <[email protected]> | |
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'%EF%BF%BD%08%0B%7F%0E-%1F', | ||
')))(((\'\'\'%22%22%22%22', | ||
'##javascript:alert(1)' | ||
'##javascript:alert(1)', | ||
'(((())))%20%5C28%20%5C29' | ||
]; | ||
testutils.test_yce(filter.yceud, testPatterns, expectedResults); | ||
}); | ||
|
@@ -422,7 +436,8 @@ Authors: Nera Liu <[email protected]> | |
'http://username:[email protected]:8080/?k1=v1&k2=v2#hash', | ||
'%EF%BF%BD%08%0B%7F%0E-%1F', | ||
')))(((\\27 \\27 \\27 %22%22%22%22', | ||
'##javascript:alert(1)' | ||
'##javascript:alert(1)', | ||
'(((())))%20%5C28%20%5C29' | ||
]; | ||
testutils.test_yce(filter.yceus, testPatterns, expectedResults); | ||
}); | ||
|