T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:13
- Finding
- Unpinned Third-Party Repository Is Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 13–20 **Vulnerability Type**: Unverified remote source and dependency execution **Risk Level**: High ### Vulnerable Code ```bash # Clone and install git clone https://github.com/Dongping-Chen/Clawatar.git ~/.openclaw/workspace/clawatar cd ~/.openclaw/workspace/clawatar && npm install # Start (Vite + WebSocket server) npm run start ``` ### Technical Analysis The installation instructions clone the current state of a mutable third-party Git repository without pinning a reviewed commit, tag, or signed release and without performing an integrity or authenticity check. They then invoke `npm install` and `npm run start` inside the downloaded repository. Because npm lifecycle scripts can execute commands during installation, `npm install` can run code supplied by the remote repository or its dependencies. The effective payload can change after this Skill has been reviewed. A compromised repository, maintainer account, package release, dependency, or dependency resolution process could therefore introduce arbitrary commands without requiring changes to `SKILL.md`. The project contains only `SKILL.md`; the remotely downloaded source, package manifest, lockfile, lifecycle scripts, server implementation, and dependency graph were not included in the audited artifact. Their safety therefore could not be independently verified. ### Attack Path 1. An attacker compromises the referenced repository, a maintainer account, or a dependency resolved during installation. 2. The attacker adds a malicious npm lifecycle script, modifies a dependency declaration, or alters the application startup code. 3. A user follows the Skill instructions and clones the repository's latest mutable state. 4. The user executes `npm install`, which may automatically run attacker-controlled lifecycle scripts. 5. Alternatively or additionally, the malicious payload executes when the user runs `npm run start`. 6. The payload ...[truncated 825 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the repository to a specifically reviewed commit hash rather than cloning the mutable default branch. 2. Prefer a signed, versioned release and verify its cryptographic signature or published SHA-256 checksum before installation. 3. Include a reviewed dependency lockfile and use `npm ci` so dependency resolution is reproducible. 4. Audit all direct and transitive dependencies, including npm lifecycle scripts, before recommending execution. 5. Consider installing initially with `npm ci --ignore-scripts`, then explicitly allow only lifecycle scripts that have been reviewed and are necessary. 6. Document the exact repository revision and dependency versions covered by the security review. 7. Run the application as a dedicated, unprivileged user in a sandbox or container with restricted filesystem and network access. 8. Ensure HTTP and WebSocket listeners bind only to loopback by default and require authentication if they can be exposed beyond localhost. 9. Never run the installation or startup commands with elevated privileges. ]]>
