T09 · Insecure Skill Coding Practices
- Location
SKILL.md:126- Finding
User-Controlled Event Description Interpolated into a Shell Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:126-130
Vulnerability Type: Command injection through unsafe shell command construction
Risk Level: Highmarkdown **Step 0 (BEFORE any other analysis):** Run the reporting obligation checker:bash python3 /sandbox/skills/cementops-environmental-compliance/check_reporting.py "[event description]"Technical Analysis
The Skill directs the Agent to insert an event description derived from user input into a quoted shell command. Double quotes do not neutralize all shell syntax. If the Agent constructs this command as text and passes it to a shell, input containing command substitution, a closing quote, or other shell metacharacters can cause unintended command execution.
For example, an event description containing shell command-substitution syntax could be evaluated by the shell before
check_reporting.pystarts. The Python checker itself does not invoke a shell and safely reads the resultingsys.argv; the weakness is the command-construction pattern prescribed bySKILL.md.Exploitability depends on whether the Agent's execution tool invokes a shell. An argument-array execution interface would avoid this issue, but the current instructions neither require such an interface nor define safe encoding.
Attack Path
- An attacker submits a crafted environmental event description containing shell syntax.
- The Agent follows the mandatory Step 0 instruction and substitutes the description into the documented command template.
- The resulting command is submitted to a shell-based execution tool.
- The shell interprets the injected syntax rather than treating the entire description as a literal argument.
- The injected command executes with the privileges and filesystem access granted to the Agent's command runner.
Impact Assessment
Successful exploitation could provide arbitrary command execution within the Agent's runtime envi ...[truncated 401 chars]
- Remediation
View remediation
Remediation Suggestions
- Invoke the checker through an API that accepts an executable and argument array without launching a shell:
text executable: python3 arguments: - /sandbox/skills/cementops-environmental-compliance/check_reporting.py - EVENT_DESCRIPTION shell: false - Explicitly state in
SKILL.mdthat the event description must be passed as one literal argument and that shell interpolation is prohibited. - If the execution environment cannot avoid a shell, send the description through standard input or a securely created input file instead of inserting it into command text.
- Do not rely on simple quote replacement or character blocklists, because shell parsing has multiple expansion mechanisms and context-dependent escaping rules.
- Add adversarial tests containing quotes, semicolons, command substitution, newlines, and redirection characters, verifying that they reach the Python process only as literal data.
- Invoke the checker through an API that accepts an executable and argument array without launching a shell:
