T09 · Insecure Skill Coding Practices
- Location
SKILL.md:145- Finding
Unsanitized Word Interpolation May Enable Shell Command Injection
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 145–166
Vulnerability Type: Shell command injection through unsafe URL construction
Risk Level: HighVulnerable Code
markdown ## Generating Wordlists Generate wordlist for a certain words based on specific hashcat rules Required args: - word: the word to generate a wordlist on using the specified hashcat rules - set: [ "online.rule", "top_3000.rule", "top_1500.rule", "top_750.rule", "top_500.rule", "top_250.rule", "nsa_64.rule", "numbers.rule", "numbers100.rule", "years_1900_2025.rule", "years.rule", "symbols.rule" ] - type: ["txt", "json"] Generate a wordlist of the word "myword" with a rule set "online.rule" using type "txt": ```bash curl -X 'GET' 'https://weakpass.com/api/v1/generate/myword?set=online.rule&type=txt' -H 'accept: text/plain'Technical Analysis
The skill directs an agent to insert a user-supplied
wordinto a URL contained within a single-quoted shell argument. Unlike the hash and prefix parameters elsewhere in the skill, thewordparameter has no documented character validation, encoding requirement, or length restriction.If an agent implements the instruction through direct textual substitution, a word containing a single quote can terminate the quoted URL. Shell control operators in the remaining input can then introduce additional commands. Merely surrounding the URL with single quotes is insufficient when untrusted input can itself contain a single quote.
The skill is documentation-only, so exploitation depends on an agent constructing and executing the demonstrated
curlcommand through unsafe substitution. The dangerous construction pattern is nevertheless presented as the operational interface.Attack Path
- An attacker asks the agent to generate a wordlist for a crafted word containing a quote, shell separator, command, and comment marker.
- For example, the supplied ...[truncated 1162 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not construct shell commands by replacing placeholders in command strings.
- Use an HTTP client that accepts the URL, path components, and query parameters as separate structured values.
- Percent-encode the
wordpath component according to RFC 3986 before adding it to the request URL. - Define and enforce explicit validation rules for the word, including permitted characters and a reasonable maximum length. Reject unsupported input rather than attempting ad hoc escaping.
- Validate
setandtypeagainst the documented fixed allowlists. - If
curlmust be used, invoke it through an argument-array API without a shell and pass each option as a distinct argument. - Update the skill documentation to require safe encoding and provide an implementation example that cannot interpret user input as shell syntax.
- Add tests covering quotes, semicolons, command substitutions, newlines, spaces, slashes, percent signs, and other shell or URL metacharacters.
- Run the agent under least privilege with restricted filesystem and network access to reduce the impact of any command-construction failure.
