T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
Shell Command Injection Through Unsafe Dynamic Arguments
- Content
View full analysis
7 --message "" ``` ```bash pilotctl --json send-message --data "" ``` ### Technical Analysis The documented commands place the dynamic `hostname` value directly into a shell command without quoting or validation. An attacker-controlled hostname containing shell metacharacters such as `;`, `|`, `&&`, redirection operators, or command substitutions can therefore alter the command executed by the shell. Although the message text is enclosed in double quotes, double-quoted shell strings still evaluate command substitutions such as `$(command)` and backticks. Embedded quotes may also terminate the intended argument and introduce additional shell syntax. Consequently, directly replacing `` with untrusted content does not make the command safe. The vulnerability is triggered if an agent or integrating system follows these examples by constructing a command string from raw or attacker-influenced hostname or message values and then evaluates that string through a shell. The issue is in the unsafe command-construction guidance; exploitation depends on dynamic values being substituted into these templates. ### Attack Path 1. An attacker supplies or influences a hostname or message that an agent is asked to send. 2. The agent substitutes the value into one of the documented Bash command templates. 3. For example, a malicious hostname could contain: ```text agent-b; id > /tmp/pilot-injection # ``` Alternatively, a malicious message could contain command substitution: ```text $(id > /tmp/pilot-injection) ``` 4. The generated command is passed to a shell. 5. The shell interprets the injected metacharacters or command substitution rather than treating the entire value as inert data. 6. The injected operating-sys ...[truncated 679 chars]- Remediation
View remediation
