T09 · Insecure Skill Coding Practices
- Location
SKILL.md:23- Finding
Shell Command Injection Through Untrusted Cookie and Task ID Substitution
- Content
View full analysis
/scripts/fetch_xingtu_authors.py" --task-id "" --cookie "" --validate ``` ``` ```markdown Run the fetch script to get all authors across all pages: ```bash python "/scripts/fetch_xingtu_authors.py" --task-id "" --cookie "" ``` ``` ### Technical Analysis The Skill instructs the Agent to interpolate user-controlled `task_id` and `cookie` values directly into textual shell commands. Double quotes do not safely neutralize all shell syntax. In particular, a value containing a double quote can terminate the intended argument, while command substitutions such as `$()` and backticks may be evaluated even inside double quotes. If the Agent executes the documented command through a shell, a malicious value can alter the command structure. Quoting the substituted value in the template is therefore not equivalent to passing it as a discrete process argument. The risk applies especially to cookies copied from a user message because the workflow explicitly treats message content as a valid source of cookie strings. ### Attack Path 1. An attacker supplies a cookie or task ID containing shell syntax, such as a quote followed by a command separator or command substitution. 2. The Agent replaces `` or `` in the documented command with the supplied value. 3. The resulting command is passed to a shell. 4. The shell interprets the injected syntax rather than treating the entire value as data. 5. The injected command executes with the operating-system privileges of the Agent process. ### Impact Assessment Successful exploitation can provide arbitrary command execution in the Agent's environment. The attacker could read or modify ...[truncated 244 chars]- Remediation
View remediation
