T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
Shell Injection Through Interpolated Deployment Parameters
- Content
View full analysis
:~/ ssh "bash ~/setup.sh 'admin@misp.local' ''" ``` ``` ### Technical Analysis The documented deployment procedure places the user-controlled SSH target and administrator password directly into shell commands. Wrapping the password in single quotes does not make interpolation safe because a password containing a single quote can terminate the quoted argument and introduce additional remote shell syntax. The SSH target is also interpolated without validation or robust argument handling. Depending on how an Agent constructs and executes the command, shell metacharacters in the target may alter local command parsing or inject unintended SSH options. For example, substituting a password shaped like the following can terminate the password argument and add a command to the remote command string: ```text x'; id; # ``` The resulting remote command is effectively parsed as: ```bash bash ~/setup.sh 'admin@misp.local' 'x'; id; #' ``` This issue exists in the Skill's prescribed execution flow, even though `setup.sh` itself quotes its positional parameters after invocation. ### Attack Path 1. An attacker or untrusted user supplies a crafted administrator password or SSH target. 2. The Agent substitutes that input into the deployment command from `SKILL.md`. 3. The local or remote shell interprets injected quoting and command separators. 4. The injected command executes under the account used for SSH deployment. 5. If that account has Docker access or elevated privileges, the attacker may subsequently control containers, mounted host resources, or potentially the host. ### Impact Assessment Successful exploitation permits arbitrary command execution on the deployment target with the privileges of the SSH user. ...[truncated 342 chars]- Remediation
View remediation
