Skip to content

Commit

Permalink
🔒 XSS 安全漏洞 Fix Vanessa219/vditor#1275
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Aug 4, 2022
1 parent 7056148 commit c9660d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion javascript/lute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/lute.min.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions render/sanitizer.go
Expand Up @@ -252,6 +252,8 @@ var eventAttrs = map[string]interface{}{
"onmousemove": nil,
"onmouseout": nil,
"onmouseover": nil,
"onmouseleave": nil,
"onmouseenter": nil,
"onmouseup": nil,
"onmousewheel": nil,
"onwheel": nil,
Expand Down
1 change: 1 addition & 0 deletions test/m2v_test.go
Expand Up @@ -20,6 +20,7 @@ import (

var md2VditorDOMTests = []parseTest{

{"25", "<input autofocus>\n<img src=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png onmouseleave=alert('XSS')>", "<div class=\"vditor-wysiwyg__block\" data-type=\"html-block\" data-block=\"0\"><pre><code>&lt;input autofocus&gt;\n&lt;img src=https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png onmouseleave=alert('XSS')&gt;</code></pre><pre class=\"vditor-wysiwyg__preview\" data-render=\"2\"><input autofocus=\"\">\n<img src=\"https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png\"></pre></div>"},
{"24", "<form ><iframe/src=\"data:text/html,<script>alert('xss');</script>\"></iframe>", "<div class=\"vditor-wysiwyg__block\" data-type=\"html-block\" data-block=\"0\"><pre><code>&lt;form &gt;&lt;iframe/src=&quot;data:text/html,&lt;script&gt;alert('xss');&lt;/script&gt;&quot;&gt;&lt;/iframe&gt;</code></pre><pre class=\"vditor-wysiwyg__preview\" data-render=\"2\"><form><iframe></iframe></pre></div>"},
{"23", "[**foo**][bar]\n\n[bar]:https://github.com", "<p data-block=\"0\">\u200b<span data-type=\"link-ref\" data-link-label=\"bar\">foo</span>\u200b</p><div data-block=\"0\" data-type=\"link-ref-defs-block\">[bar]: https://github.com\n</div>"},
{"22", "<span class=\"vditor-comment\" data-cmtids=\"20201105091940-wtpsc3a\">foo</span>", "<p data-block=\"0\"><span class=\"vditor-comment\" data-cmtids=\"20201105091940-wtpsc3a\">foo</span></p>"},
Expand Down

0 comments on commit c9660d0

Please sign in to comment.