fix(security): 跨网点病历存储型 XSS 双侧消毒(SEC-02 / P1) #223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/p1-security-2026-06-23"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
P1 安全修复:跨网点病历存储型 XSS(SEC-02)
全量系统测试(PR #222 报告 §六 SEC-02)发现并经监工代码核实的 P1:他院病历只读调阅经
dangerouslySetInnerHTML渲染RichTextEditor(execCommand)产出的原生 HTML,此前全前端无消毒 → 恶意网点可在病历content注入<script>/<img src=x onerror=...>,他院跨网点查阅时在其会话执行(存储型、跨租户 XSS)。改动
utils/sanitizeHtml.ts:DOMPurify 白名单消毒(仅放行富文本排版标签 + 安全属性,剥离 script/事件处理器/危险协议)。dangerouslySetInnerHTML渲染用户 HTML 处:CrossClinicRecordsSection.tsx、CrossClinicTab.tsx(跨网点只读渲染点)RichTextEditor.tsx载入已存 HTML 时(防御纵深)dompurify@^3.4.11门禁
npm run typecheck0 错 ·vitest227 passed ·vite build通过范围说明
claude/frosty-knuth-efd579(PR#221),折入前端重构 PR;CrossClinicRecordsSection/RichTextEditor与 main 一致,故 main 生产侧同问题随 #221 合入修复。full_name对patient:profile:read开放是后端注释记录的产品决策;真缺口=姓名静态加密,作为独立迁移任务排期(SEC-01 降为待排期硬化)。🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.