T09 · Insecure Skill Coding Practices
- Location
scripts/slides_json_to_pptx.py:39- Finding
Unvalidated SVG Content Is Embedded Verbatim into Generated PPTX Files
- Content
View full analysis
list[Path]: svg_dir.mkdir(parents=True, exist_ok=True) svg_paths: list[Path] = [] for index, slide in enumerate(slides, start=1): svg_path = svg_dir / f"slide_{index:03d}.svg" svg_path.write_text(slide["svg"], encoding="utf-8") svg_paths.append(svg_path) ``` The resulting file is subsequently copied directly into the PPTX package: ```python for index, svg_path in enumerate(svg_paths, start=1): media_name = f"slide_{index:03d}.svg" shutil.copyfile(svg_path, media_dir / media_name) ``` ### Technical Analysis The loader verifies only that the `svg` property is a non-empty string. It does not parse the document or enforce the SVG restrictions described in `SKILL.md`, such as rejecting scripts, styles, filters, HTML content, or unsupported elements. Consequently, attacker-controlled slide JSON or compromised model output can introduce arbitrary XML and SVG features into the generated presentation. Potentially dangerous content includes: - `script` elements and SVG event-handler attributes. - `foreignObject` elements containing HTML. - External resource references through `href`, `xlink:href`, CSS, or image elements. - DTD declarations o ...[truncated 1769 chars]- Remediation
View remediation
