T08 · Insecure Dependencies
Warning
- Location
- modules/validation-protocols.md:27
- Finding
- Unpinned npm Packages Are Downloaded and Executed## Vulnerability Details **File Location**: `modules/validation-protocols.md:27-29, 57-58, 95, 100`; `modules/red-flags.md:16` **Vulnerability Type**: Supply-chain exposure through mutable and unpinned npm packages **Risk Level**: Medium ### Vulnerable Code From `modules/validation-protocols.md`: ```bash CCLSP_CONFIG_PATH=./config.json npx cclsp@latest & sleep 2 ps aux | grep cclsp ``` ```bash npm install -g cclsp echo $? # Must be 0 ``` ```bash npx cclsp@latest --help ``` ```bash CCLSP_CONFIG_PATH=config.json npx cclsp@latest & ``` From `modules/red-flags.md`: ```bash CCLSP_CONFIG_PATH=config.json npx cclsp@latest ``` ### Technical Analysis The validation instructions encourage agents to use `npx cclsp@latest`, which resolves and executes a mutable package release at runtime. Consequently, the code that executes is not fixed to the version reviewed with this Skill. The global installation example, `npm install -g cclsp`, is also unversioned and modifies the host environment. No lockfile, exact version, package-integrity hash, trusted publisher verification, or isolated execution environment is specified. npm package binaries and installation lifecycle scripts may execute with the invoking user's privileges. A compromised package, publisher account, registry response, or unexpectedly changed release could therefore introduce code absent from the audited project. Other unpinned tool invocations in the same document, such as `npx tsc`, carry a similar dependency-resolution concern if the package is not already installed from a trusted, locked dependency tree. ### Attack Path 1. An agent follows the Skill's validation protocol. 2. It runs `npx cclsp@latest` or installs the unversioned package globally. 3. npm resolves the package from the external registry at execution time. 4. A compromised or malicious current release supplies installation scripts or a package binary. 5. npm or `npx` executes that code with the agent user's permissions. 6. The pay ...[truncated 777 chars]
- Remediation
- ## Remediation Suggestions 1. Replace `@latest` and unversioned installations with an exact, reviewed version: ```bash npm install --save-exact cclsp@X.Y.Z ``` 2. Commit and enforce a lockfile, and use `npm ci` rather than unconstrained installation. 3. Verify registry package ownership, provenance, and integrity before use. 4. Avoid global installation. Install dependencies in an isolated temporary project, container, or restricted development environment. 5. Prefer execution from an already locked local dependency tree: ```bash npx --no-install cclsp --help ``` 6. Pin all other `npx` tools to reviewed local dependencies rather than permitting implicit registry downloads. 7. Run third-party package code with minimum privileges, restricted credentials, limited network access, and no sensitive environment variables.
