T09 · Insecure Skill Coding Practices
- Location
SKILL.md:134- Finding
Predictable Shared Temporary Paths Permit File Collisions and Symlink Attacks
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:134-135;strategy-schema.md:274-276
Vulnerability Type: Predictable and shared temporary-file paths
Risk Level: MediumRelevant source excerpt from
SKILL.md:134-135(English translation):text 3. File paths use the original paths provided by the user; intermediate products use the `/tmp/ve_strategy/` prefix. 4. Steps in `execution_plan` must be serially executable; later steps may depend on the output of preceding steps.Relevant source excerpt from
strategy-schema.md:274-276(English translation):text - `execution_plan[].inputs` may use the `output` path of a preceding step. - Intermediate product paths uniformly use the `/tmp/ve_strategy/` prefix. - The final output path is written to `project.output_path`.Examples throughout
examples.md, including lines 222-326, 484-536, and 712-814, use predictable names such as:text /tmp/ve_strategy/merged_raw.mp4 /tmp/ve_strategy/with_text.mp4 /tmp/ve_strategy/clips/s1.mp4Technical Analysis
The Skill requires generated execution plans to place intermediate media in a fixed, shared directory. It does not require a unique per-execution directory, restrictive directory permissions, exclusive file creation, ownership checks, or symbolic-link rejection.
On systems where another user or process can write under
/tmp, predictable names can be created before the downstream FFmpeg-related Skill runs. A pre-created path may be an attacker-controlled regular file or a symbolic link to another location. If the downstream tool follows symbolic links or overwrites existing files, it may read attacker-controlled content or overwrite a file selected by the attacker.Serial dependencies amplify this issue because subsequent steps trust prior output paths without requiring verification that the files were created by the current execution. Concurrent executions can also overwrite ...[truncated 1412 chars]
- Remediation
View remediation
Remediation Suggestions
- Create a cryptographically unpredictable, per-execution temporary directory using the platform's secure temporary-directory API.
- Set directory permissions to
0700and verify that the current process owns the directory. - Generate unpredictable intermediate filenames instead of fixed names such as
merged_raw.mp4. - Create outputs atomically and exclusively so existing paths cause failure rather than overwrite.
- Refuse symbolic links and validate ownership and file type before every intermediate read or write.
- Keep every generated intermediate path inside the canonicalized per-run directory and reject path traversal or directory escape.
- Prevent one execution from accepting intermediate files created by another execution.
- Clean up only the unique directory created by the current run; never recursively remove a shared fixed path.
- Document these requirements in both
SKILL.mdandstrategy-schema.mdso downstream Skills enforce the same protections.
