T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:26
- Finding
- Unpinned Remote npm Package Is Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 26–37 **Vulnerability Type**: Remote execution of an unpinned third-party dependency **Risk Level**: High ### Vulnerable Code ```bash ## Preferred Direct CLI Prefer the direct CLI when the agent can run shell commands. It does not require MCP server configuration: ```bash npx -y socialdatax-skills@latest xhs hot-search \ --pretty --source-client socialdatax-skills --source-platform clawhub \ --source-skill xhs-hot-topic-selection npx -y socialdatax-skills@latest xhs search \ --keyword "<hot_topic_or_keyword>" --sort-type like_count_descending --pages 2 \ --max-items 20 --pretty --source-client socialdatax-skills --source-platform clawhub \ --source-skill xhs-hot-topic-selection ``` ``` The project metadata also declares the same package without an exact version: ```yaml metadata: {"openclaw":{"requires":{"env":["SOCIALDATAX_API_KEY"],"bins":["node","npm"]},"primaryEnv":"SOCIALDATAX_API_KEY","install":[{"kind":"node","package":"socialdatax-skills","bins":[]}],"emoji":"🧭","homepage":"https://socialdatax.com/ai?from=clawhub"}} ``` ### Technical Analysis The instructions use `npx -y socialdatax-skills@latest`, which downloads and immediately executes the current package release without pinning an audited version or integrity hash. The `-y` option suppresses the installation confirmation, while `@latest` allows the effective executable payload to change after this Skill has been reviewed. The downloaded implementation is not present in the audited project. There is also no lockfile, checksum, signature requirement, or vendored source through which its runtime behavior can be verified. This package executes in an environment that is expected to contain `SOCIALDATAX_API_KEY`. It may also inherit the invoking agent's filesystem access, environment variables, process permissions, and network capabilities. Consequently, compromise of the package publisher, registry account, distr ...[truncated 1481 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace `socialdatax-skills@latest` with an exact, reviewed package version. 2. Pin the package's integrity hash through a lockfile or an equivalent verified installation mechanism. 3. Remove `npx -y` from the recommended workflow so installation or version changes are not silently accepted. 4. Vendor the reviewed implementation where practical, allowing its behavior to be audited with the Skill. 5. Verify package signatures or provenance attestations before execution. 6. Run the CLI in a restricted sandbox with: - Access only to the required API key. - No access to unrelated environment variables. - Read-only or narrowly scoped filesystem permissions. - Outbound network access limited to documented service endpoints. 7. Document the exact expected API hosts and reject unexpected redirects or destinations. 8. Establish a controlled dependency-update process in which new versions are reviewed before the pinned version is changed. ]]>
