T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
Shell Command Injection Through Unescaped User-Controlled Arguments
- Content
View full analysis
/scripts/dr-client.js \ --input "" \ --output "" \ --format "" \ --timeout 900000 ``` ### Technical Analysis The documented workflow places the user-controlled research topic and save path directly into a shell command enclosed only by double quotation marks. Double quotes do not provide a safe security boundary when the interpolated value itself contains a quotation mark, command substitution, or other shell syntax. If the sub-agent follows this instruction by constructing and executing a shell command string, an attacker can terminate the quoted argument and append additional commands. The JavaScript argument parser does not cause this vulnerability because shell parsing occurs before Node.js receives the arguments. For example, a malicious topic could be structured conceptually as: ```text legitimate topic"; attacker-command; # ``` The precise payload depends on the shell and execution environment. The unsafe construction also affects the user-controlled output path. ### Attack Path 1. An attacker supplies a malicious research topic or save path containing a closing quotation mark and shell metacharacters. 2. The Agent inserts the value into the command template described in `SKILL.md`. 3. A sub-agent or command-execution tool runs the resulting value through a shell. 4. The shell interprets the injected text as syntax rather than as a single argument. 5. The injected command executes with the same operating-system privileges and environment access as the Agent or sub-agent. Exploitation is conditional on the documented command being assembled as a shell command string. Passing arguments directly as an array without a shell would prevent this attack. ### Impact Assessment Successful exploitation could ...[truncated 629 chars]- Remediation
View remediation
