T08 · Insecure Dependencies
Warning
- Location
- rules/install.md:11
- Finding
- Unpinned and Inconsistently Named npm Packages May Execute Untrusted Code<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5-7`, `rules/install.md:11-22`, `rules/install.md:47-51`, and `rules/security.md:23-25` **Vulnerability Type**: Unpinned third-party dependency execution and package-name inconsistency **Risk Level**: Medium ### Vulnerable Code `SKILL.md:5-7`: ```yaml allowed-tools: - Bash(anycrawl *) - Bash(npx anycrawl *) ``` `rules/install.md:11-22`: ```markdown ## Quick Setup (Recommended) ```bash npx -y anycrawl-cli init ``` This installs `anycrawl-cli` globally and prompts for authentication. ## Manual Install ```bash npm install -g anycrawl-cli ``` ``` `rules/install.md:47-51`: ```markdown 1. Ensure npm global bin is in PATH 2. Try: `npx anycrawl-cli --version` 3. Reinstall: `npm install -g anycrawl-cli` ``` `rules/security.md:23-25`: ```markdown # Installation ```bash npm install -g anycrawl-cli ``` ``` ### Technical Analysis The Skill permits `npx anycrawl *`, while its installation documentation identifies the intended package as `anycrawl-cli`. These are distinct npm package names. If the `anycrawl` executable is unavailable locally, `npx anycrawl` may resolve and execute a package named `anycrawl` rather than the documented `anycrawl-cli`. The installation commands also omit an exact package version and integrity constraint. Consequently, `npx -y anycrawl-cli init` may download and execute whichever release is currently resolved by npm. The `-y` option suppresses the normal confirmation prompt. Similarly, `npm install -g anycrawl-cli` installs a mutable package globally and may execute npm lifecycle scripts during installation. This creates a supply-chain exposure: package compromise, account takeover, dependency compromise, or accidental execution of the inconsistently named package could result in arbitrary code execution. The audit did not establish that either package is currently malicious; the vulnerability is the unsafe and ambiguous dependency acquisition mechanism. ### Att ...[truncated 1288 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the ambiguous `Bash(npx anycrawl *)` permission and consistently use the verified `anycrawl-cli` package and executable. 2. Pin the dependency to a reviewed exact version, for example: ```bash npx --yes anycrawl-cli@<reviewed-exact-version> init ``` 3. Record and verify package integrity and provenance before execution. Where practical, use a lockfile and a trusted registry configuration. 4. Avoid global installation. Install the package as a project-local development dependency and invoke the locked local binary. 5. Do not automatically approve first-time package execution with `-y` unless the exact package version and provenance have already been verified. 6. Review npm lifecycle scripts and the transitive dependency tree before approving upgrades. 7. Ensure all documentation, tool permissions, and examples use one canonical package name. 8. Run the CLI with least privilege in an isolated environment, without unrelated credentials or sensitive files. ]]>
