T09 · Insecure Skill Coding Practices
- Location
scripts/mermaid_render_multi.js:287- Finding
Untrusted Mermaid Content Is Rendered in an Unsandboxed Browser with Permissive Security Settings
- Content
View full analysis
console.log('SUCCESS')) .catch(err => { console.error('ERROR:', err.message); process.exit(1); }); ``` ### Technical Analysis The renderer accepts Mermaid content from an input file and processes it in a headless browser. The browser is launched with both its normal sandbox and setuid sandbox disabled. Chromium-based browsers also receive `--allow-file-access-from-files`, while Mermaid is initialized with `securityLevel: 'loose'`. Disabling the browser sandbox is not necessary for the declared diagram-rendering functionality in a normally configured environment. It removes a major containment boundary around a complex parser and browser engine. The `loose` Mermaid setting and broad file-origin access further weaken defense in depth when processing diagrams that may originate from an untrusted PRD or `.mmd` file. The code does not itself contain a demonstrated browser exploit. Exploitation would require malicious Mermaid content capable of abusing an applicable Mermaid, SVG, or browser vulnerability. Nevertheless, the configuration materially increases the consequences of such a vulnerability. ### Attack Path 1. An attacker provides a crafted Markdown PRD containing a malicious Mermaid block, or directly provides a crafted `.mmd` file. 2. The user invokes the DOCX export workflow or the M ...[truncated 1234 chars]- Remediation
View remediation
