T09 · Insecure Skill Coding Practices
- Location
scripts/audit.sh:181- Finding
Predictable Temporary Report Path Permits File Overwrite
- Content
View full analysis
-suspicious.txt`. 3. Before the audit runs, the attacker creates that path as a symbolic link to a file writable by the auditing account. 4. The scanned Skill contains a line that causes `SUSPICIOUS_CODE` to become nonempty. 5. During L3 analysis, `cp` writes the collected content to the predictable path. 6. If the platform permits following the link, the linked destination is overwritten with attacker-influenced source text. ### Impact Assessment Exploitation may cause: - Over ...[truncated 475 chars]- Remediation
View remediation
&2 return 1 } chmod 600 "$output_file" || { rm -f -- "$output_file" return 1 } cp -- "$SUSPICIOUS_CODE" "$output_file" || { rm -f -- "$output_file" return 1 } ``` Additional hardening should include: - Registering the generated report in the exit trap unless persistence is explicitly requested. - Avoiding shared temporary directories when a private runtime directory is available. - Never deriving a security-sensitive temporary filename solely from attacker-influenced input. - Using `--` before path operands to prevent option interpretation. - Documenting when a report is deliberately retained and where it is stored. ]]>
