T09 · Insecure Skill Coding Practices
- Location
index.js:17- Finding
Arbitrary Command Execution Through Shell Injection in Repository URL
- Content
View full analysis
{ exec(cmd, { timeout }, (err, stdout, stderr) => { if (err) reject(err); else resolve(stdout); }); }); } ``` ### Technical Analysis The user-controlled `repoUrl` is directly interpolated into a command string passed to Node.js `child_process.exec`. The `exec` function launches a shell, so shell metacharacters in the URL are interpreted as command syntax. The regular expression is not a security boundary. It merely searches for a substring resembling `github.com/owner/repository`; it does not anchor the input, validate the URL hostname, constrain the complete repository path, or reject characters such as semicolons, command substitutions, pipes, redirections, or shell comments. Consequently, an input can contain a syntactically valid GitHub substring and additional shell commands. ### Attack Path 1. An attacker invokes the skill with a repository argument such as: ```text https://github.com/example/repository; touch /tmp/clawhub-pwned # `` ...[truncated 1033 chars]- Remediation
View remediation
