T09 · Insecure Skill Coding Practices
- Location
SKILL.md:284- Finding
Shell Command Injection Through an Unsanitized User-Derived Run Directory
- Content
View full analysis
_/` and write a `context.md` file with the domain, constraints, customer segments, founder profile, and 8 seeds with their slug names. ``` The resulting directory is subsequently interpolated into shell commands. For example: ```bash for i in 01 02 03 04 05 06 07 08; do cat "/pool/${i}_prd.md" \ "/pool/${i}_critique.md" \ > "/pool/${i}_dossier.md" done ``` The same unsafe interpolation pattern is used when assembling final dossiers: ```bash for i in 01 02 03 04 05 06 07 08; do cat "/pool/${i}_prd.md" \ "/pool/${i}_critique.md" \ "/pool/${i}_evaluation.md" \ > "/pool/${i}_dossier.md" done ``` ### Technical Analysis The Skill directs the orchestrator to derive a filesystem path from the domain supplied during the conversation. It does not require validation, canonicalization, slug generation, or shell-safe argument handling before substituting that path into Bash commands. Wrapping the substituted value in double quotes is insufficient if the orchestrator constructs a shell command by textual interpolation. Shell constructs embedded in the value, including command substitution such as `$(command)`, remain active inside double-quoted shell text. Embedded quotation marks or control operators could also alter the intended command structure. For example, a malicious domain resembling the following could become part of `run_dir`: ```text payments_$(id>/tmp/sco ...[truncated 2233 chars]- Remediation
View remediation
