T09 · Insecure Skill Coding Practices
- Location
scripts/export-png.py:29- Finding
JavaScript Injection Through Unescaped Excalidraw JSON
- Content
View full analysis
str: return f""" `. An attacker can place such a sequence inside a valid Excalidraw text property, terminate the containing script element, and append a new attacker-controlled script element. The resulting payload executes when Playwright visits the generated `render.html` page. Execution occurs before the Excalidraw export completes and in a browser configured with outbound network access and disabled Chromium sandboxing. ### Attack Path 1. An attacker creates a syntactically valid `.excalidraw` document. 2. A string property, such as an element's `text` value, contains an HTML-breaking payload based on ``. 3. A user or automated agent invokes `export-png.p ...[truncated 1238 chars]- Remediation
View remediation
`, `&`, U+2028, and U+2029 before insertion. - Validate the top-level Excalidraw schema and impose limits on input size, element count, and string lengths. - Add regression tests containing ``, HTML tags, Unicode separators, and malformed data. - Enable Chromium sandboxing and restrict browser egress to reduce the effect of any future rendering injection. ]]>
