T09 · Insecure Skill Coding Practices
- Location
scripts/send-qr.mjs:12- Finding
Shell Command Injection Through Unescaped Conversation Context
- Content
View full analysis
- Remediation
View remediation
", "--target", "", "--media", "", "--message", "" ] } ``` 3. Invoke the process through a shell-free API such as `spawn()` or `execFile()` with an argument array and `shell: false`. 4. Apply strict allowlists to `channel` and `targetId`. Reject values containing whitespace, control characters, shell metacharacters, or characters outside the platform's documented identifier syntax. 5. Do not rely exclusively on shell escaping. Validation plus shell-free execution should be the primary security controls. 6. Update `SKILL.md` so the Agent never executes dynamically generated command strings. 7. Add tests containing values such as semicolons, command substitutions, quotes, newlines, and option-like prefixes to verify that they are rejected or treated strictly as arguments. ]]>
