我试图弄清楚 ReactJS 可能会出现什么样的安全问题,但我无法找到任何问题。在 Google 上快速搜索 Angular 会带来一些有用的网站。它们适用于 ReactJS 还是有人可以解释一下?
最佳答案
正如 @WiredPrarie 所指出的,React 自动 escapes for XSS .
If you want to display an HTML entity within dynamic content, you will run into double escaping issues as React escapes all the strings you are displaying in order to prevent a wide range of XSS attacks by default.
可以看到最近发现的漏洞的示例 here ,但早已修复。
另请参阅此 link关于插入原始 html。
请注意,使用同构/服务器端渲染可能会产生潜在的漏洞,特别是在初始状态嵌入到要提供服务的页面中的情况下。看这个link .
关于ReactJS 中的安全漏洞或漏洞?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30225241/