Merge pull request #844 from chjj/data_link_fix

added data link fix to prevent xss
This commit is contained in:
Matt Austin 2017-01-20 09:47:29 -08:00 committed by GitHub
commit 8f9d0b72f5
3 changed files with 5 additions and 2 deletions

View File

@ -875,7 +875,7 @@ Renderer.prototype.link = function(href, title, text) {
} catch (e) { } catch (e) {
return ''; return '';
} }
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
return ''; return '';
} }
} }

View File

@ -2,3 +2,4 @@
<p></p> <p></p>
<p></p> <p></p>
<p></p> <p></p>
<p></p>

View File

@ -5,3 +5,5 @@
[URL](javascript&colon;alert&#40;1&#41;) [URL](javascript&colon;alert&#40;1&#41;)
[URL](javascript&#58document;alert&#40;1&#41;) [URL](javascript&#58document;alert&#40;1&#41;)
[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)