T09 · Insecure Skill Coding Practices
- Location
SKILL.md:41- Finding
Shell Command Injection Through Unsafe Parameter Interpolation in curl Templates
- Content
View full analysis
","resume_version":"resume_v1"}'` - Review: - `curl -sS -X POST "http://127.0.0.1:8010/api/material/review" -H "Content-Type: application/json" -d '{"thread_id":"","decision":"approve"}'` - Export: - `curl -sS -X POST "http://127.0.0.1:8010/api/material/export" -H "Content-Type: application/json" -d '{"thread_id":"","format":"pdf"}'` ``` ### Technical Analysis The Skill instructs the Agent to invoke an execution tool with shell-formatted `curl` commands. The `job_id` and `thread_id` placeholders are placed directly inside single-quoted shell arguments without validation or shell-safe encoding. The `job_id` value may be supplied directly by a user. The `thread_id` value is obtained from a local API response and therefore crosses a separate trust boundary. If either value contains a single quote, it can terminate the surrounding shell argument. Additional shell operators and commands can then be introduced before the remainder of the command is neutralized, for example using a comment operator. JSON quoting does not protect values from shell interpretation. The shell parses and expands the command before `curl` receives the JSON body. Using a JSON serializer alone is also insufficient if the resulting JSON is subsequently concatenated into a shell command string. The vulnerability is exploitable when the Agent follows these templates by replacing placeholders in a command string and passes that string to a shell-based execution tool. ### Attack Path 1. An attacker supplies a crafted `job_id` containing a single quote followed by shell syntax. Alternatively, a compromised or ...[truncated 1470 chars]- Remediation
View remediation
