T09 · Insecure Skill Coding Practices
- Location
SKILL.md:6- Finding
Shell Command Injection Through Unrestricted Bash Arguments
- Content
View full analysis
--json ``` ```bash openant tasks comment --content "..." --json ``` ### Technical Analysis The skill grants access to Bash commands with arbitrary trailing arguments through the wildcard patterns `openant tasks comments *` and `openant tasks comment *`. It then instructs the agent to interpolate a task ID and comment content directly into shell command strings. No validation rules are specified for `taskId`, and no shell-safe mechanism is required for passing comment content. If attacker-controlled values are inserted literally, shell metacharacters in a task ID could terminate or extend the intended command. Comment content enclosed in double quotes may also permit command substitution through constructs such as `$()` or break out of the quoted argument when quotes are not safely escaped. The `--json` requirement only affects the OpenAnt command's output format. It does not prevent the shell from evaluating malicious syntax before invoking the CLI. ### Attack Path 1. An attacker supplies a crafted task ID or requests that the agent post attacker-controlled comment content. 2. The agent follows the documented examples and interpolates the supplied value into an allowed Bash command. 3. The crafted value introduces shell syntax, such as a command separator, quote termination, or command substitution. 4. Bash evaluates the injected syntax in addition to the intended `openant` command. 5. The injected command executes with the operating-system privileges and environment access available to the agent process. Exploitation depends on attacker-controlled data being inserted into the shell command without robust validatio ...[truncated 759 chars]- Remediation
View remediation
