T09 · Insecure Skill Coding Practices
- Location
scripts/render_fingering_pdf.py:190- Finding
Predictable Temporary Files Permit Symlink-Based File Overwrite
- Content
View full analysis
.overlay-tmp.pdf` - `.source-tmp.pdf` These files are not created through an exclusive temporary-file API. `Path.write_bytes()` follows symbolic links and does not protect against a file being replaced between validation and use. If the output directory is writable by another local user or process, that party can create one of the predictable temporary paths as a symbolic link to another file. The renderer then follows the link and overwrites the target with generated PDF data. The unconditional cleanup also removes the temporary path after use. When that path is a symbolic link, cleanup removes the link rather than restoring or validating it; the linked target remains corrupted. This is a local file-system vulnerability and does not independently grant access to files that the account running the Skill cannot already write. ### Attack Path 1. An attacker determines the renderer's intended output path, such as `/s ...[truncated 1311 chars]- Remediation
View remediation
