Skip to content

Commit db365d0

Browse files
authored
Merge pull request #205 from flavorjones/flavorjones-test-unicode-encoded-exploit
test: actually test against a working unicode-encoded exploit
2 parents 4a6be02 + 895b5f4 commit db365d0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/assets/testdata_sanitizer_tests1.dat

+22
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,33 @@
3434
},
3535

3636
{
37+
/* original */
3738
"name": "div_background_image_unicode_encoded",
3839
"input": "<div style=\"background-image:\u00a5\u00a2\u006C\u0028'\u006a\u0061\u00a6\u0061\u00a3\u0063\u00a2\u0069\u00a0\u00a4\u003a\u0061\u006c\u0065\u00a2\u00a4\u0028.1027\u0058.1053\u0053\u0027\u0029'\u0029\">foo</div>",
3940
"output": "<div>foo</div>"
4041
},
4142

43+
{
44+
/* from https://owasp.org/www-community/xss-filter-evasion-cheatsheet */
45+
"name": "div_background_image_unicode_encoded2",
46+
"input": "<DIV STYLE=\"background-image:\u0075\u0072\u006C\u0028'\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u003a\u0061\u006c\u0065\u0072\u0074\u0028.1027\u0058.1053\u0053\u0027\u0029'\u0029\">foo</div>",
47+
"output": "<div>foo</div>"
48+
},
49+
50+
{
51+
/* uh, fix what appear to be typos that have propagated over the years */
52+
"name": "div_background_image_unicode_encoded3",
53+
"input": "<DIV STYLE=\"background-image:\u0075\u0072\u006C\u0028'\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u003a\u0061\u006c\u0065\u0072\u0074\u0028\u0027\u0058\u0053\u0053\u0027\u0029'\u0029\">foo</div>",
54+
"output": "<div>foo</div>"
55+
},
56+
57+
{
58+
/* and finally a version that has a chance of actually demonstrating a javascript vulnerability */
59+
"name": "div_background_image_unicode_encoded4",
60+
"input": "<DIV STYLE=\"background-image:\u0075\u0072\u006C\u0028'\u006a\u0061\u0076\u0061\u0073\u0063\u0072\u0069\u0070\u0074\u003a\u0061\u006c\u0065\u0072\u0074\u0028\u0031\u0032\u0033\u0034\u0029'\u0029\">foo</div>",
61+
"output": "<div>foo</div>"
62+
},
63+
4264
{
4365
"name": "div_expression",
4466
"input": "<div style=\"width: expression(alert('XSS'));\">foo</div>",

0 commit comments

Comments
 (0)