T09 · Insecure Skill Coding Practices
- Location
scripts/speak.sh:7- Finding
Unrestricted Output Path and Predictable Temporary File
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi OUTPUT="$(mktemp --tmpdir="$OUTPUT_DIR" 'speech.XXXXXX.mp3')" chmod 600 -- "$OUTPUT" ``` - If caller-selected destinations are required, canonicalize the requested path and allow writes only beneath a dedicated, Agent-owned output directory. - Reject symbolic links and non-regular existing destinations. Where supported, use file-opening semantics equivalent to `O_NOFOLLOW` and exclusive creation. - Avoid a shared fixed filename so concurrent invocations cannot overwrite or disclose each other's output. - Run the Skill as an unprivileged account with access only to its dedicated output directory. - Delete generated files after they have been delivered, unless retention is explicitly required. - Check the exit status of `edge-tts` before printing or sending the output path, and remove partial output following a failed invocation. ]]>
