T07 · Tool Hijacking and Spoofing
Error
- Location
- SKILL.md:153
- Finding
- System-Wide ClawHub CLI Modification and Forced License Acceptance<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 153-159 **Vulnerability Type**: `T07: Tool Hijacking and Spoofing` **Risk Level**: High ### Vulnerable Code ```bash PUBLISH_JS=$(find /usr/local/lib -name "publish.js" -path "*/clawhub/*" | head -1) grep -q "acceptLicenseTerms" "$PUBLISH_JS" || \ sed -i 's/skillName:/acceptLicenseTerms: true, skillName:/' "$PUBLISH_JS" ``` ### Technical Analysis The Skill instructs the agent to locate and directly modify a JavaScript file belonging to a system-wide ClawHub CLI installation. This changes the behavior of a trusted local tool instead of limiting changes to the generated Skill package. The target is selected using `find` followed by `head -1`, without verifying the package version, installation path, file integrity, or expected source structure. If multiple matching installations or unrelated matching files exist, the command may modify the wrong file. The `sed` replacement is also structure-unaware and may corrupt the CLI or inject the property at an unintended location. Adding `acceptLicenseTerms: true` automatically bypasses an explicit license-acceptance failure. This makes a legal and security-relevant decision without obtaining explicit user consent. The modification persists after the current Skill run and affects later ClawHub operations performed by other sessions or users of the same installation. Altering a global tool is not required for the declared GitHub-to-ClawHub conversion workflow and exceeds minimum privilege. ### Attack Path 1. A publication attempt returns a `400` error associated with `acceptLicenseTerms`. 2. The agent follows the documented remediation procedure. 3. The agent searches `/usr/local/lib` and selects the first matching `publish.js`. 4. If the agent has sufficient filesystem privileges, `sed -i` permanently modifies that file. 5. Subsequent ClawHub CLI calls execute the modified implementation and automatically assert acceptance of license terms. 6 ...[truncated 956 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove the global CLI patching procedure from the Skill. - Do not modify files under `/usr/local/lib` or any other system-wide package directory. - Do not automatically assert acceptance of legal terms. Require the user to review and explicitly accept them through the official interface. - Resolve the compatibility problem by upgrading to an official fixed release of the ClawHub CLI. - If no fixed release is available, stop publication and report the incompatibility instead of editing installed dependencies. - Pin and verify the supported CLI version before publication. - Run the Skill with a dedicated, unprivileged account that cannot write to system package directories. - If any local workaround is unavoidable, use a user-approved, isolated copy of the CLI with integrity checks and a documented rollback procedure. ]]>
