T09 · Insecure Skill Coding Practices
- Location
SKILL.md:65- Finding
Shell Command Injection Through Unvalidated Session and Thread Identifiers
- Content
View full analysis
" \ --message-thread-id "" \ --ttl-minutes 30 ``` ``` ### Technical Analysis The Skill permits the raw command argument to become an explicit `sessionKey`, then directs the Agent to interpolate that value and the runtime-provided `MessageThreadId` into a textual command. Wrapping an interpolated value in double quotes is not sufficient shell escaping. If a value contains a quote followed by shell syntax, it can terminate the quoted argument and introduce additional commands. For example, a value shaped like `" ; attacker-command ; #` may be interpreted as shell syntax rather than as a single session identifier. Validation inside `preview-diff.mjs` cannot prevent this issue because command substitution and parsing occur before the Node.js process starts. Exploitability depends on the OpenClaw runtime executing the documented command through a shell rather than using a shell-free argument-array API. ### Attack Path 1. An attacker submits `/savenow ` with quote characters and shell metacharacters embedded in the explicit session key. 2. The Skill accepts the raw argument as the resolved `sessionKey`. 3. The A ...[truncated 1079 chars]- Remediation
View remediation
