mirror of
https://github.com/markedjs/marked
synced 2024-11-23 09:48:17 +00:00
added data: link fix to prevent xss
This commit is contained in:
parent
38f1727ffe
commit
cd2f6f5b70
@ -875,7 +875,7 @@ Renderer.prototype.link = function(href, title, text) {
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
|
||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
@ -4,4 +4,6 @@
|
||||
|
||||
[URL](javascript:alert(1))
|
||||
|
||||
[URL](javascript:document;alert(1))
|
||||
[URL](javascript:document;alert(1))
|
||||
|
||||
[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)
|
Loading…
Reference in New Issue
Block a user