T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
Shell Command Injection Through Unsafe Quoting of User-Controlled Input
- Content
View full analysis
' > /tmp/jd.txt tamar tailor --job /tmp/jd.txt # Safe: single-quote the argument to prevent shell expansion tamar tailor --job 'https://example.com/jobs/12345' ``` ```bash tamar tailor --job /tmp/jd.txt --resume '' ``` ```bash echo '' > /tmp/feedback.txt tamar feedback "$(cat /tmp/feedback.txt)" ``` The same unsafe patterns appear in `instructions.md`: ```bash # Safe: write JD to a temp file, pass the file echo '' > /tmp/jd.txt tamar tailor --job /tmp/jd.txt # Safe: single-quote the argument to prevent shell expansion tamar tailor --job 'https://example.com/jobs/12345' ``` ```bash tamar tailor --job /tmp/jd.txt --resume '' ``` ```bash echo '' > /tmp/feedback.txt tamar feedback "$(cat /tmp/feedback.txt)" ``` ### Technical Analysis The skill instructs the agent to place user-controlled job descriptions, URLs, feedback, and file paths directly inside shell single-quoted strings. It incorrectly characterizes this construction as safe. A single quote contained in the input terminates the quoted shell token. The remaining input can then introduce shell operators such as semicolons, pipelines, command substitutions, or redirections. Merely surrounding an untrusted string with literal single quotes is not equivalent to safely encoding that string as a shell argument. The affected input sources include: - Pasted job-description text - Job-description URLs - Natural-language feedback - User-supplied resume paths The vulnerability is particularly significant because job descriptions may be copied from remote or attacker-controlled sources. If an agent foll ...[truncated 1486 chars]- Remediation
View remediation
