T08 · Insecure Dependencies
Warning
- Location
- README.md:14
- Finding
- Unpinned npm Packages Are Downloaded and Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `README.md:12-22`; `docs/publish-to-clawhub.md:9-15, 29-35` **Vulnerability Type**: Unpinned executable dependency **Risk Level**: Medium ### Vulnerable Code ```bash # README.md npx skills add 11cafe/zopia-skills ``` ```bash # README.md npx clawhub install zopia-skill ``` ```bash # docs/publish-to-clawhub.md npx clawhub login ``` ```bash # docs/publish-to-clawhub.md npx clawhub publish /path/to/zopia-skills \ --slug zopia-skill \ --version <new-version> \ --changelog "change description" ``` ### Technical Analysis The documentation instructs users and maintainers to invoke the `skills` and `clawhub` npm packages through `npx` without specifying reviewed package versions or integrity hashes. When the requested package is not already available locally, `npx` can retrieve the current registry version and execute its entry point. Consequently, the code executed by these commands is not fixed to the version considered during this audit. A compromised npm publisher account, malicious package update, dependency compromise, or package ownership change could cause future installations or publishing operations to execute attacker-controlled code. This issue is especially relevant to `clawhub login` and `clawhub publish`, which may run in an environment containing persistent ClawHub authentication state, repository contents, and other developer credentials. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or one of its runtime dependencies. 2. The attacker publishes a malicious version under the package name used by the documented `npx` command. 3. A user follows the installation or publishing instructions without specifying a version. 4. `npx` resolves and downloads the malicious current version. 5. The package executes with the privileges of the invoking user. 6. The malicious package can access files, environment variables, repository data, and authentication materi ...[truncated 629 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every executable npm package to an exact, reviewed version: ```bash npx --yes skills@<reviewed-version> add 11cafe/zopia-skills npx --yes clawhub@<reviewed-version> install zopia-skill ``` 2. Record the approved package name, npm scope, publisher identity, version, and integrity digest in the documentation. 3. Prefer installation from a lockfile-controlled development environment rather than dynamically executing the latest registry release. 4. Review package provenance and signatures where supported by the registry. 5. Run publishing tools from a restricted environment with only the credentials and repository access required for publication. 6. Re-audit and deliberately update the pinned version when upgrading the CLI. ]]>
