-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何开启xss防御 #472
Comments
吓得我 |
得去看看 |
所以你的项目有这个问题吗? 或者你怎么解决的? |
我暂时还没又发现耶,可能是因为我对这个不是特别熟悉吧。 |
可是我不知道咋整呀 |
这是比较严重的安全问题,如果你项目对安全性要求很高的话! |
嗯嗯,感谢 |
555 |
@hinesboy 大哥,这个怎么解决啊 |
这个用转义 newStr = unHtml(str) console.log(newStr) // <p></p> |
刚npm安装完这插件就提示有安全漏洞了,貌似全部版本都有影响,只能自己先解决了 |
前端不太熟,不知道怎么办,但我在写后端时我是直接用spring的HtmlUtils做转义的。 |
你这个方法可以解决他一边输入一边预览时xss吗? 俗称XSS自己。 |
这个问题后台转义没用的,因为他是在输入的时候即时XSS,在输入完成后前端把数据传给后台时前端可以进行转义,后台也可以转义。 |
反正我后来是放了了这个编辑器,换了别的。因为我们对安全要求很高,XSS自己也不行。 |
大哥,最后你换成了那个编辑器,能推荐下吗 |
I just intalled this editor, soon after...
Visiting the npm advisory website I get this: Any updates? This is bad security practice... |
|
So I gave up and recommend you my new one |
any updates? High Cross-Site Scripting Package mavon-editor Patched in No patch available Dependency of mavon-editor Path mavon-editor More info https://npmjs.com/advisories/1169 |
可以考虑用xss插件进行转义 |
Any news regarding this variability? |
I think, this issue has been resolved in version 2.8.2 https://snyk.io/vuln/SNYK-JS-MAVONEDITOR-459108 check #548 |
would be nice to have NPM stop showing this issue! |
Already mailed to npm security advisories. @jonathanpmartins you can mail them again |
This issue has been fixed, see Snyk Report If you have any questions, you can comment. |
好像并没有解决... |
xss过滤默认不开启,如需开启,你可以在data中声明 例子仅供参考: <template>
<div id="editor">
<mavon-editor v-model="aaa" style="height: 100%" :xssOptions="xssOptions"></mavon-editor>
</div>
</template>
<script>
module.exports = {
name: "editor",
data() {
return {
aaa:"",
xssOptions: {
whiteList: {
img: ["src", "alt", "width", "height"],
},
stripIgnoreTagBody: true
}
};
},
computed: {},
methods: {}
};
</script>
<style>
#editor {
margin: auto;
width: 80%;
height: 580px;
}
</style> |
|
你可以试试用代码块包起来,应该可以到达这种效果 |
这看上去是xss开启带来的副作用,后面需要优化,当然我们也欢迎PR。 |
The text was updated successfully, but these errors were encountered: