Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在使用editor.md时发现,HTML过滤中存在XSS注入问题。
与issues:
#1018 #985 #916 #890 #861 等
is:issue state:open xss遇到的问题一致。
在对于嵌入式前端编辑/展示,或存储在数据库中是极为危险的XSS漏洞。
原本过滤规则
原本使用的过滤规则为:
<a href="x" onclick=eval("alert('xss');")>xss</a><img src=x onerror="alert(1)"/>修改后过滤规则
标签|属性名|属性值,其中属性名、属性值支持通配符推荐使用的过滤规则为:
!!注意:过度过滤会使原有的md标签被过滤
常见XSS样本
参考:https://www.freebuf.com/articles/web/340080.html
修复后:

(使用推荐的过滤规则)