Skip to content

fix(security): sanitize Mermaid SVG rendering - #165

Draft
16th-admin wants to merge 3 commits into
mainfrom
codex/fix-mermaid-svg-sanitization
Draft

fix(security): sanitize Mermaid SVG rendering#165
16th-admin wants to merge 3 commits into
mainfrom
codex/fix-mermaid-svg-sanitization

Conversation

@16th-admin

@16th-admin 16th-admin commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Sanitize both Mermaid SVG output and parser-generated HTML with DOMPurify before inserting them into the document.

Root cause

The rich-text renderer inserted generated markup directly into the DOM, which triggered CodeQL's DOM-text-to-HTML alert.

Validation

  • ESLint on src/services/pltxt2htm/advancedParser.ts: 0 errors
  • git diff --check
  • Vite build attempted; the shared dependency directory prevented Vite from writing its temporary config file

This is intentionally separate from the ESLint refactor in #147.

Comment thread src/services/pltxt2htm/advancedParser.ts Fixed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Codex-Style Code Review by OpenCode

💡 This is an automated advisory review. It is non-blocking and does not affect merge requirements.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Codex-Style Code Review by OpenCode

💡 This is an automated advisory review. It is non-blocking and does not affect merge requirements.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Codex-Style Code Review by OpenCode

💡 This is an automated advisory review. It is non-blocking and does not affect merge requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants