From 12e8343068b906f8b2afddc5569968a8a91fa5b0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 29 Apr 2024 06:24:24 +0200 Subject: Adding upstream version 2.1.0. Signed-off-by: Daniel Baumann --- tests/test_port/fixtures/xss.md | 128 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 tests/test_port/fixtures/xss.md (limited to 'tests/test_port/fixtures/xss.md') diff --git a/tests/test_port/fixtures/xss.md b/tests/test_port/fixtures/xss.md new file mode 100644 index 0000000..7c0512e --- /dev/null +++ b/tests/test_port/fixtures/xss.md @@ -0,0 +1,128 @@ +. +[normal link](javascript) +. +

normal link

+. + + +Should not allow some protocols in links and images +. +[xss link](javascript:alert(1)) + +[xss link](JAVASCRIPT:alert(1)) + +[xss link](vbscript:alert(1)) + +[xss link](VBSCRIPT:alert(1)) + +[xss link](file:///123) +. +

[xss link](javascript:alert(1))

+

[xss link](JAVASCRIPT:alert(1))

+

[xss link](vbscript:alert(1))

+

[xss link](VBSCRIPT:alert(1))

+

[xss link](file:///123)

+. + + +. +[xss link]("><script>alert("xss")</script>) + +[xss link](Javascript:alert(1)) + +[xss link](&#74;avascript:alert(1)) + +[xss link](\Javascript:alert(1)) +. +

xss link

+

[xss link](Javascript:alert(1))

+

xss link

+

xss link

+. + +. +[xss link]() +. +

[xss link](<javascript:alert(1)>)

+. + +. +[xss link](javascript:alert(1)) +. +

[xss link](javascript:alert(1))

+. + + +Should not allow data-uri except some whitelisted mimes +. +![](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) +. +

+. + +. +[xss link](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) +. +

[xss link](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)

+. + +. +[normal link](/javascript:link) +. +

normal link

+. + + +Image parser use the same code base as link. +. +![xss link](javascript:alert(1)) +. +

![xss link](javascript:alert(1))

+. + + +Autolinks +. + + + +. +

<javascript:alert(1)>

+

<javascript:alert(1)>

+. + + +Linkifier +. +javascript:alert(1) + +javascript:alert(1) +. +

javascript:alert(1)

+

javascript:alert(1)

+. + + +References +. +[test]: javascript:alert(1) +. +

[test]: javascript:alert(1)

+. + + +Make sure we decode entities before split: +. +```js custom-class +test1 +``` + +```js custom-class +test2 +``` +. +
test1
+
+
test2
+
+. -- cgit v1.2.3