T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Unvalidated video ID is interpolated into a shell command
- Content
View full analysis
/tmp/yt-transcript.json ``` Replace `VIDEO_ID` with the extracted ID. Read the output from `/tmp/yt-transcript.json`. ``` ### Technical Analysis The Skill instructs the agent to extract attacker-controlled text from a URL and substitute it directly into a command executed by a shell. Although the documentation describes a direct video ID as 11 characters, it does not require validation against YouTube's actual identifier alphabet, such as `^[A-Za-z0-9_-]{11}$`. The value is embedded inside a shell double-quoted argument. Shell expansions such as command substitution can therefore be interpreted before Node.js receives the script. The value is also inserted into a JavaScript single-quoted string, creating a second injection boundary. The command is run from `/root/clawd`, which strongly suggests that it may execute with elevated privileges. Direct string interpolation is not necessary for transcript retrieval and violates least-privilege and safe command-construction principles. ### Attack Path 1. An attacker sends the agent a crafted YouTube-looking URL whose `v` parameter contains shell or JavaScript metacharacters. 2. The Skill detects the URL and treats the parameter as `VIDEO_ID`. 3. Because t ...[truncated 1184 chars]- Remediation
View remediation
