T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:10
- Finding
- Unpinned Third-Party npm Package Is Installed Globally and Trusted with an API Key## Vulnerability Details **File Location**: `SKILL.md`, lines 10-15 and 45-46 **Vulnerability Type**: Unpinned and unaudited third-party dependency **Risk Level**: Medium ### Vulnerable Code ```yaml install: - id: node kind: node package: bazaar.it bins: - baz ``` ```bash npm install -g bazaar.it baz auth login <your-api-key> ``` ### Technical Analysis The skill instructs the agent to globally install the `bazaar.it` npm package without specifying a version, lockfile, package integrity hash, or other reproducibility control. Consequently, the code installed during each invocation depends on whichever package version the npm registry resolves at that time. npm packages can execute lifecycle scripts during installation. A global installation can also place the package's executable in the user's global npm binary directory. The instructions subsequently execute that binary and provide it with a Bazaar API key through `baz auth login`. The repository contains only `SKILL.md`; it does not include the package source or other evidence that would allow the installed implementation and its lifecycle scripts to be audited as part of this project. No evidence establishes that the current `bazaar.it` package is malicious. The security issue is the absence of dependency pinning and integrity controls around a package that is globally installed, executed, and entrusted with a credential. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or the relevant package distribution channel. 2. The attacker publishes a malicious release under the package name `bazaar.it`. 3. An agent follows the skill instructions and runs `npm install -g bazaar.it` without a pinned version. 4. npm retrieves the attacker-controlled release and may execute its installation lifecycle scripts with the installing user's privileges. 5. The installed `baz` executable is placed in the global ...[truncated 1234 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to a specifically reviewed version rather than installing the latest available release: ```bash npm install --global --ignore-scripts bazaar.it@<reviewed-version> ``` 2. Verify the selected release's npm integrity metadata and publisher identity before installation. Record the reviewed version and expected integrity value in the skill documentation. 3. Prefer a project-local installation governed by a committed lockfile instead of a global installation: ```bash npm install --save-exact bazaar.it@<reviewed-version> npx --no-install baz ... ``` 4. Audit the package source, transitive dependencies, and npm lifecycle scripts for the pinned release. Use `--ignore-scripts` when lifecycle scripts are unnecessary. 5. Run the CLI in a sandbox or container with only the filesystem and network access required for video generation. Do not expose unrelated home-directory files, SSH credentials, cloud credentials, or broad environment variables. 6. Supply a narrowly scoped API key where the service supports scoped credentials. Avoid placing the key directly in shell history or command-line arguments, and rotate it immediately if package compromise is suspected. 7. Document a trusted installation source, release-verification procedure, update-review process, and credential-revocation procedure.
