T09 · Insecure Skill Coding Practices
- Location
scripts/generate_visual.py:218- Finding
Arbitrary File Write Through Unsanitized Output Slug
- Content
View full analysis
/../../target.html`. An absolute slug can also cause `pathlib` path joining to discard the intended output directory. The affected write operations can overwrite an existing HTML file. When `--png` is enabled, the PNG destination is derived from the same unsafe value. ### Attack Path 1. An attacker controls the command-line arguments or persuades the Agent to invoke the renderer with a crafted `--slug`. 2. The attacker supplies a value such as `../../some/writable/target`. 3. The program joins the unvalidated slug with the intended output directory. 4. Path resolution escapes the designated output directory. 5. `write_text()` creates or overwrites the resulting HTML file using the privileges of the process. 6. If `--png` is enabled, Playwright also writes a PNG to the attacker-selected path. Exploitation requires that the destination's parent directory already exist and be writable by the process. ### Impact Assessment An attacker can create or ...[truncated 373 chars]- Remediation
View remediation
