T09 · Insecure Skill Coding Practices
- Location
SKILL.md:42- Finding
Shell Command Injection Through Untrusted Parameter Interpolation
- Content
View full analysis
' \ ./.venv/bin/python -m toutiao_poster post \ --title '' \ --content-text '<content>' \ ``` The same unsafe interpolation pattern also appears in the publishing and image-upload examples at lines 52–55, 64–69, 78–80, 103–106, and 139–142. ### Technical Analysis The skill instructs an agent to substitute user-controlled `cookie_header`, `title`, and `content` values directly into a shell command. Wrapping a placeholder in literal single quotes is not sufficient sanitization: an input containing a single quote can terminate the quoted string and introduce shell operators or additional commands. For example, if raw substitution is used, a title shaped like the following can escape the intended argument: ```text '; attacker_command; # ``` The vulnerability applies to other interpolated values as well, including image paths. Whether exploitation succeeds depends on the calling agent constructing and executing the documented command through a shell without robust argument escaping. The artifact does not contain the caller or the referenced `toutiao_poster` implementation, so that runtime behavior could not be independently verified. ### Attack Path 1. An attacker supplies a crafted title, article body, cookie header, or image path containing a single quote and shell metacharacters. 2. The agent replaces the corresponding placeholder in the documented shell template with the supplied value. 3. The inserted single quote closes the intended quoted argument. 4. The system shell interprets the remaining attacker-controlled text as shell syntax. 5. The injected command executes with the operating-system privileges of the account running the skill, identified in the document as an Ubuntu environment. ### Impact Assessment Successful exploitation c ...[truncated 559 chars]- Remediation
View remediation
