dy-dashboard/vault/知识库/工作指南/训练记录/2026-07-23-知识库存储型XSS安全修复.md
2026-10-28 11:14:17 +08:00

13 lines
991 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 知识库存储型XSS安全修复
### 1. 知识库存储型XSS安全修复
**旭东 → OpenClaw:**
> 存在完整的存储型 XSS 攻击链
> 现在优化这个
**OpenClaw 响应:**
已按规则仅在 192.168.8.186 测试环境完成知识库存储型 XSS 修复,没有修改生产或云端。新增本地 DOMPurify 3.2.6,将知识库文章、资料库和个人画像三处 Markdown 渲染统一改为先由 marked 解析,再由 DOMPurify 净化;禁止 script、style、iframe、object、embed、form 标签和 style 属性,依赖缺失时自动降级为纯文本。同步升级 app.js 和 Service Worker 缓存版本。JavaScript/Python 静态检查及 diff 检查通过,7 组常见 XSS 载荷全部被清除。测试服务已重启并为 active,登录页、DOMPurify 和新版 app.js 均 HTTP 200,知识库匿名访问仍返回 code=401,Gunicorn 4 个 worker 启动正常。Git 提交:29d22aa(fix: sanitize knowledge markdown rendering)。
**已记录**