T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:41
- Finding
- Command Injection Through Unsafely Interpolated Prospect Input<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:41`, `SKILL.md:47-49`, `SKILL.md:61`, `SKILL.md:82`, `SKILL.md:88`, `SKILL.md:94`, `SKILL.md:100`, and `SKILL.md:106-108` **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```bash node tools/clis/firecrawl.js scrape [prospect-url] ``` ```bash node tools/clis/firecrawl.js scrape [prospect-url]/about node tools/clis/firecrawl.js scrape [prospect-url]/pricing node tools/clis/firecrawl.js scrape [prospect-url]/team ``` ```bash node tools/clis/firecrawl.js map [prospect-url] ``` ```bash node tools/clis/exa.js search "[company name] funding" --num-results 5 ``` ```bash node tools/clis/exa.js search "[company name] news 2025 2026" --num-results 5 ``` ```bash node tools/clis/exa.js search "[company name] technology stack" --num-results 5 ``` ```bash node tools/clis/exa.js search "[company name] reviews" --num-results 5 ``` ```bash node tools/clis/exa.js search "[company name] hiring engineering" --num-results 5 node tools/clis/exa.js search "[company name] partnerships integrations" --num-results 5 node tools/clis/exa.js search "[company name] CEO interview" --num-results 5 ``` ### Technical Analysis The Skill instructs the agent to collect a prospect URL and company name from the user and interpolate those values into command-line templates. It does not require URL validation, shell-metacharacter rejection, argument escaping, or execution through a structured argument array. The URL placeholder is unquoted. If the resulting command is interpreted by a shell, a malicious URL containing command separators, redirection operators, pipelines, or command substitutions could alter the intended command and execute additional commands. The company name is enclosed in double quotes, but double quoting alone does not prevent all shell evaluation. In common shells, constructs such as command substitution remain active inside double-quoted strings. Consequently, a cr ...[truncated 1805 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Use structured process execution** - Invoke Node.js directly through an API that accepts an executable and an argument array. - Pass the prospect URL or company name as a discrete argument. - Do not assemble a shell command string from user-controlled content. - Disable shell execution explicitly where the process API supports that option. 2. **Validate prospect URLs** - Parse each value with a standards-compliant URL parser. - Permit only the `http:` and `https:` schemes. - Reject credentials embedded in URLs, control characters, malformed hosts, and unexpected whitespace. - Construct paths such as `/about` with a URL API rather than string concatenation. 3. **Constrain company-name input** - Reject control characters and line breaks. - Apply a reasonable length limit. - Treat the entire company name as inert data and never evaluate it as shell syntax. 4. **Add explicit security instructions to the Skill** - State that placeholders must never be substituted into shell command strings. - Require safe argument-array execution for all Firecrawl and Exa calls. - Warn that quoting alone is not a sufficient defense against shell command substitution. 5. **Apply least privilege** - Run research tooling in a sandbox with narrowly scoped filesystem access. - Expose only the credentials required for Firecrawl and Exa. - Restrict unnecessary outbound network access and prevent access to unrelated project secrets. 6. **Add adversarial tests** - Test URLs and company names containing command separators, pipes, redirects, quotes, line breaks, and command-substitution syntax. - Confirm that each payload reaches the CLI as one literal argument and is never evaluated by a shell. ]]>
