T09 · Insecure Skill Coding Practices
Warning
- Location
SKILL.md:27- Finding
Potential PowerShell Command Injection Through Unvalidated File Path and Filename
- Content
View full analysis
" "https://filebin.net/$binId/" ``` ``` ### Technical Analysis The Skill instructs the Agent to insert a user-selected file path and filename directly into a PowerShell command. It does not require validation, shell-safe argument passing, or filename URL encoding. Double quotes do not make arbitrary untrusted values safe for PowerShell command construction. If the Agent replaces the placeholders textually and invokes the resulting command through PowerShell, a malicious path or filename containing a double quote and PowerShell syntax could terminate the intended argument and introduce an additional command. The filename is also inserted into a URL path without percent-encoding it as an individual URL component. This can cause malformed requests or unintended URL interpretation even when command injection is not achieved. Exploitation depends on the Agent constructing this command through textual substitution rather than passing the values as discrete arguments to a process-execution API. ### Attack Path 1. An attacker creates, supplies, or directs the Agent to a file whose path or filename contains PowerShell-significant characters. 2. The user asks the Skill to upload that file. 3. The Agent locates the file under `~/.openclaw/workspace/`. 4. The Agent replaces `` or `` in the documented command with the attacker-controlled value. 5. If the replacement value terminates the quoted argument, PowerShell interprets the remaining injected syntax as a command. 6. The injected command executes with the operating-system privileges and accessible resources of the Agent process. ### Impa ...[truncated 483 chars]- Remediation
View remediation
