fix(web): ArticlePhonePreview XSS 修复 — DOMPurify 净化 dangerouslySetInnerHTML

- 安装 dompurify + @types/dompurify
- ArticlePhonePreview 使用 DOMPurify.sanitize() 防止 HTML 注入
This commit is contained in:
iven
2026-05-21 22:34:58 +08:00
parent fd994edf3e
commit 21481dbd88
3 changed files with 31 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
"antd": "^6.3.5",
"axios": "^1.15.0",
"dayjs": "^1.11.20",
"dompurify": "^3.4.5",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-router-dom": "^7.14.0",
@@ -36,6 +37,7 @@
"@tailwindcss/vite": "^4.2.2",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/dompurify": "^3.2.0",
"@types/node": "^24.12.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",