T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
Command Injection Through Unsafely Interpolated User Query
- Content
View full analysis
" ``` ### Technical Analysis The documented execution pattern places an untrusted, natural-language user query directly inside a shell command. Double quotation marks do not prevent all shell interpretation. For example, command substitutions using `$(...)` or backticks may still be evaluated by the shell. A query containing quotation marks may also terminate the intended argument and append additional shell syntax. The vulnerability applies when an agent or integration follows this example by constructing a command string and passing it to a shell. It can be avoided if the executable is invoked directly using a structured argument array with shell processing disabled, but that safe execution requirement is not documented. ### Attack Path 1. An attacker submits a query containing shell metacharacters or command-substitution syntax. 2. The agent substitutes the complete query into the documented command template. 3. The resulting command string is executed through a shell. 4. The shell evaluates the attacker's substitution or injected command. 5. The injected command executes with the privileges and environmental access of the agent process. ### Impact Assessment Successful exploitation could provide arbitrary command execution under the account running OpenClaw or AgentOctopus. Depending on that account's privileges, an attacker could read or modify accessible files, obtain credentials exposed through files or environment variables, invoke network utilities, alter local configuration, or compromise subsequent agent operations. The scope is limited by the operating-system permissions and sandbox restrictions applied to the agent process. ]]>- Remediation
View remediation
