T09 · Insecure Skill Coding Practices
- Location
scripts/setup_notifications.py:406- Finding
Unvalidated Devpod Host Allows SSH Option Injection and Local Command Execution
- Content
View full analysis
/dev/null 2>&1; then error "Cannot SSH to $host. Ensure the devpod is running." fi ssh "$host" "mkdir -p ~/.claude/scripts" scp "$SCRIPTS_DIR/notify.sh" "$host:~/.claude/scripts/notify.sh" ssh "$host" "chmod +x ~/.claude/scripts/notify.sh" ``` ### Technical Analysis The value supplied through `--devpod` is accepted without validation and passed to `ssh` as a positional argument. Using an argument array or shell quoting prevents shell metacharacter expansion, but it does not prevent the SSH client from interpreting a value beginning with `-` as a command-line option. A malicious host value can therefore inject SSH options. Of particular concern is `ProxyCommand`, which instructs the local SSH client to run a helper command. The command runs on the local Mac with the privileges of the user executing the setup script. The same unvalidated value is reused across multiple `ssh` and `scp` calls, increasing the available attack surface. This behavior is not necessary for the declared notification fun ...[truncated 1303 chars]- Remediation
View remediation
str: if not HOST_PATTERN.fullmatch(host): error("Invalid devpod SSH host or alias") return host ``` ]]>
