T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:91
- Finding
- Unpinned ClawHub CLI Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, lines 91–94 **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium ### Vulnerable Code ```bash npx clawhub login npx clawhub publish . --name "首席风险官" --version "1.0.0" --tags "风险,管理,合规,监控" ``` ### Technical Analysis The deployment instructions execute the `clawhub` npm package through `npx` without specifying an exact package version or verifying its integrity. If the package is not available locally, `npx` may retrieve the currently published version from the configured package registry and execute it immediately. Consequently, the code executed by these instructions can change after the skill has been reviewed. Compromise of the package publisher, registry account, package distribution infrastructure, or a future package release could introduce attacker-controlled code. The risk is especially relevant to the login command because the invoked process may have access to credentials, tokens, environment variables, and files available to the publishing user. ### Attack Path 1. An attacker compromises the `clawhub` package publisher, its registry account, or the relevant package distribution channel. 2. The attacker publishes a modified package version containing malicious installation or runtime code. 3. A user follows the documented `npx clawhub login` or `npx clawhub publish` instructions without having a trusted local version installed. 4. `npx` retrieves the current package release from the configured registry. 5. The attacker-controlled package executes with the privileges and environment of the user running the command. 6. The malicious package may access publishing credentials, environment variables, project files, or other resources available to that user. ### Impact Assessment Successful exploitation permits arbitrary code execution under the operating-system account that runs the documented commands. The resulting access ...[truncated 655 chars]
- Remediation
- ## Remediation Suggestions - Pin the CLI to an explicitly reviewed version instead of resolving the latest release dynamically, for example: ```bash npx --yes clawhub@<reviewed-exact-version> login npx --yes clawhub@<reviewed-exact-version> publish . --name "Chief Risk Officer" --version "1.0.0" --tags "risk,management,compliance,monitoring" ``` - Prefer declaring the reviewed CLI version in a package manifest and committing the generated lockfile. Install it with a deterministic command such as `npm ci`, then invoke the locked local binary. - Verify the package name, publisher identity, provenance, signatures, and registry source before approving a version. - Configure an approved registry rather than relying on an uncontrolled or user-specific registry configuration. - Review package installation scripts and the dependency tree before execution. Where compatible with the package, disable unnecessary lifecycle scripts. - Run publishing tools from an isolated, least-privileged environment with access only to the project and credentials required for publication. - Use short-lived, narrowly scoped publication tokens and avoid exposing unrelated secrets through environment variables. - Separate installation, verification, authentication, and publication into explicit documented steps so users do not implicitly download and execute unreviewed code.
