T09 · Insecure Skill Coding Practices
- Location
SKILL.md:48- Finding
Shell Command Injection Through Unescaped Alert Fields
- Content
View full analysis
", "Message": "", "X-S4-ExternalID": "", "X-S4-Status": "new", "X-S4-Service": "", "X-S4-AlertingScenario": "", "X-S4-Location": "", "X-S4-SourceSystem": "OpenClaw" }' ``` ### Technical Analysis The skill instructs the agent to insert user-controlled alert fields directly into a single-quoted shell argument. It does not require JSON serialization, shell escaping, or passing values separately from executable shell syntax. A single quote in any substituted value can terminate the `-d` argument. Subsequent shell metacharacters can then introduce a new command. This affects the title, message, external ID, service, alerting scenario, and location fields. For example, if direct textual substitution is used, a field shaped like the following can escape the quoted JSON and introduce a separate command: ```text '; id > /tmp/signl4-proof; # ``` Ordinary input containing quotes, backslashes, or line breaks can also produce malformed JSON even when it is not intentionally malicious. ### Attack Path 1. An attacker supplies a crafted title, message, external ID, or optional alert field. 2. The agent substitutes that value into the documented `curl` command. 3. The attacker-supplied single quote terminates the shell's quoted JSON argument. 4. Shell separators introduce an additional command, while a comment marker suppresses the remaining template. 5. The agent invokes the generated command through a shell. 6. The injected command executes with the same o ...[truncated 697 chars]- Remediation
View remediation
