T09 · Insecure Skill Coding Practices
- Location
SKILL.en.md:56- Finding
Command Injection Through Unvalidated Installation Source
- Content
View full analysis
"$TEMP_DIR/skill" ``` ```bash cd "$TEMP_DIR" npm pack mkdir skill tar xzf *.tgz --strip-components=1 -C skill/ rm -f *.tgz ``` ### Technical Analysis The Skill directs the Agent to extract a URL or npm package name from user input and substitute it directly into a command executed through `exec`. The source argument is not quoted, syntactically validated, restricted to an allowlist, or separated from shell interpretation. If the Agent performs literal template substitution, shell metacharacters in a crafted source can terminate or extend the intended `git clone` or `npm pack` command. Option-like inputs may also change the invoked tool's behavior. Critically, this processing occurs before the downloaded Skill is reviewed, so the security scan cannot protect against commands embedded in the installation-source input itself. The same vulnerable instructions are present in both language variants. ### Attack Path 1. An attacker provides a crafted installation source containing shell metacharacters or an option-like value. 2. The Skill recognizes the input as a Git URL, Git source, or npm package specification. 3. The Agent substitutes the untrusted value into the documented shell command. 4. The Agent invokes the resulting command through its `exec` tool. 5. The shell interprets the injected syntax as an additional command or altered command behavior. 6. The injected operation executes before any downloaded files undergo the seven-item review. ### Impact Assessment Successful exploitation can execute arbitrary commands with all operating-system privileges available to the Agent process. Depending on those privileges, an attacker could read accessible files and ...[truncated 308 chars]- Remediation
View remediation
