open-code-review/pages/src
kite 9dfcffda07
fix(pages): address CodeQL XSS alerts in markdown rendering (#300)
* fix(pages): address CodeQL XSS alerts in markdown rendering

Alert #4 (headingId.ts): replace the unreliable single-pass regex used to
strip HTML tags (incomplete multi-character sanitization) with DOMPurify.
This also fixes a pre-existing mismatch where headings containing HTML
entities produced different anchor ids on the TOC vs renderer sides.

Alert #5 (MarkdownRenderer.tsx): mermaid runs with securityLevel:'strict'
and already sanitizes its own SVG output, so re-running DOMPurify over the
whole SVG broke rendering (namespaces, inline <style>, foreignObject
labels). Make securityLevel explicit and inject mermaid's trusted output
directly, annotated with a codeql suppression comment.

* docs(pages): clarify CodeQL XSS suppression justification in MarkdownRenderer

The suppression comment claimed the mermaid SVG is 'not raw user input',
which understates the trust boundary. The SVG is in fact derived from
user-controlled mermaid code; safety relies on mermaid's securityLevel:
'strict' sanitizing the output via DOMPurify. Update the comment to state
this accurately and flag that the boundary depends on that setting.
2026-07-06 10:31:37 +08:00
..
assets feat(pages): add Docs page with search, markdown rendering, and i18n support (#273) 2026-07-03 11:45:33 +08:00
components fix(pages): address CodeQL XSS alerts in markdown rendering (#300) 2026-07-06 10:31:37 +08:00
content/docs docs(pages): sync restructured MCP guide to en and ja (#293) 2026-07-03 20:04:35 +08:00
hooks feat(pages): consolidate icons, add scroll-to-top, responsive titles (#241) 2026-06-29 15:44:41 +08:00
i18n docs(pages): add MCP servers guide to the user guide (#292) 2026-07-03 19:03:27 +08:00
pages feat(pages): add per-chapter routes for docs (#294) 2026-07-03 20:29:29 +08:00
styles feat(pages): add Docs page with search, markdown rendering, and i18n support (#273) 2026-07-03 11:45:33 +08:00
utils fix(pages): address CodeQL XSS alerts in markdown rendering (#300) 2026-07-06 10:31:37 +08:00
App.tsx feat(pages): add per-chapter routes for docs (#294) 2026-07-03 20:29:29 +08:00
assets.d.ts refactor: cleanup design drafts, rename Chinese assets, UI improvements (#239) 2026-06-29 14:42:43 +08:00
index.tsx refactor: cleanup design drafts, rename Chinese assets, UI improvements (#239) 2026-06-29 14:42:43 +08:00