T09 · Insecure Skill Coding Practices
- Location
main.py:235- Finding
Local Command Injection Through Remote-Controlled Skill Names
- Content
View full analysis
&1 | tail -3") if result != 0: print(f" ⚠️ Installation may have failed") ``` ### Technical Analysis The value `s` is included directly in a command passed to `os.system()`. This API invokes a local shell, so shell metacharacters contained in the skill name are interpreted as command syntax rather than as part of a single argument. The skill names used by `sync-to-local` originate from the remote host's skill-directory listing. A compromised or malicious remote server can therefore influence the value reaching this command. Neither an allowlist nor shell escaping is applied. ### Attack Path 1. An attacker gains control of the configured remote host or its OpenClaw skills directory. 2. The attacker creates a skill entry whose filename contains shell syntax, such as a command separator followed by an attacker-selected command. 3. The operator invokes `sync-to-local`. 4. The malicious name is returned by `list_skills()` and included in `remote_only`. 5. The operator confirms the synchronization, or the command is run with `--yes`. 6. `os.system()` passes the constructed string to the local shell. 7. The injected command executes with the privileges of the local user running the skill. ### Impact Assessment Successful exploitation provides arbitrary command execution on the local OpenClaw machine. The attacker can access files available to the invoking account, modify the OpenClaw workspace, install additional software, steal credentials, or pivot to other systems. If the skill runs as root, the injected command receives full local administrative privileges. ]]>- Remediation
View remediation
