T09 · Insecure Skill Coding Practices
- Location
SKILL.md:284- Finding
Shell Command Injection Through Unquoted Target URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 284 and 324
Vulnerability Type: Shell command injection caused by unsafe interpolation of attacker-controlled input
Risk Level: HighVulnerable Code
markdown 1. Fetch the page with curl (no JavaScript execution): `curl -s [URL]`markdown - Measure with curl: `curl -o /dev/null -s -w 'TTFB: %{time_starttransfer}s\n' [URL]`Technical Analysis
The skill directs a Bash-capable agent to collect a URL from the user and substitute it directly into shell commands. The
[URL]argument is neither quoted nor validated. If an implementation performs direct textual substitution, shell metacharacters in the supplied URL can terminate or alter the intendedcurlcommand.Because the skill explicitly permits the
Bashtool, the resulting command can be interpreted by a system shell rather than passed tocurlas a safely isolated argument. Characters used for command separation, command substitution, redirection, or pipelines could therefore cause unintended commands to execute.The vulnerability is present in both the raw-HTML retrieval command and the TTFB measurement command.
Attack Path
- An attacker requests an audit for a target value containing shell control syntax rather than a conventional URL.
- The agent substitutes that value for
[URL]in one of the documentedcurlcommand templates. - The completed command is submitted to the Bash tool without strict validation or argument isolation.
- Bash interprets the injected shell syntax separately from the intended
curlinvocation. - The injected command runs with the operating-system permissions and filesystem access granted to the agent process.
- Command output may be returned directly or incorporated into the generated audit, while destructive commands could alter accessible files or project state.
Impact Assessment
Successful exploitation can provide arbitrary command execution within the secur ...[truncated 622 chars]
- Remediation
View remediation
Remediation Suggestions
-
Prefer a structured HTTP-fetching tool such as
WebFetchthat accepts the URL as a discrete parameter and does not invoke a shell. -
If
curlis required, store the validated URL in a variable and pass it as a quoted argument:bash curl --silent --show-error -- "$URL"For timing:
bash curl --output /dev/null --silent --show-error \ --write-out 'TTFB: %{time_starttransfer}s\n' -- "$URL" -
Parse the input with a standards-compliant URL parser before execution.
-
Permit only the
httpsand, where explicitly necessary,httpschemes. -
Reject credentials in URLs, control characters, malformed encodings, and unexpected shell syntax.
-
Do not construct commands through string concatenation or textual placeholder replacement.
-
Where available, invoke processes through an argument-array API without
shell=true. -
Run network audit operations in a restricted sandbox with minimal filesystem access, no unnecessary credentials, and constrained outbound connectivity.
-
