React 中安全的 Markdown 渲染:灵活性与安全性的平衡
hackerone.com | 漏洞 | #web-security | #xss | #react | #frontend-security | #markdown | #dompurify | #sanitization
摘要
在 React 中渲染用户提交的 Markdown 存在 XSS 风险:默认转义 HTML 的 react-markdown 是安全首选;若确需支持 HTML,应在传入 dangerouslySetInnerHTML 前用 DOMPurify 净化,并防止净化后再被改动。
- 发布时间
- 收录时间
Skip to content