T09 · Insecure Skill Coding Practices
- Location
SKILL.md:51- Finding
Shell Command Injection Through Raw User-Supplied Share Text
- Content
View full analysis
" ``` The surrounding instructions require the Agent to place the complete, untrusted share text received from the user directly inside the quoted command-line argument. ### Technical Analysis The Skill instructs the Agent to interpolate raw user input into a shell command. Shell double quotes do not neutralize every form of shell evaluation. Command substitutions such as `$(command)` and backtick substitutions are still evaluated inside double quotes. An embedded quotation mark may also terminate the intended argument and allow additional shell syntax to be introduced. Consequently, a malicious share message can cause shell commands to execute before `douyin_skill.py` starts. The Python URL-extraction logic does not mitigate this issue because exploitation occurs in the shell before Python receives the argument. This behavior is not necessary for the declared transcription functionality. User input can be passed through standard input or a subprocess argument array without invoking a shell parser. ### Attack Path 1. An attacker submits share text containing a syntactically valid URL and shell substitution syntax, such as: ```text $(attacker-controlled-command) https://v.douyin.com/example/ ``` 2. The Agent follows `SKILL.md` and embeds the complete text into the documented shell command. 3. The shell evaluates the command substitution despite the surrounding double quotes. 4. The injected command executes with the same operating-system privileges, filesystem access, environment variables ...[truncated 661 chars]- Remediation
View remediation
