T08 · Insecure Dependencies
- Location
SKILL.md:12- Finding
Unpinned Global npm Dependency Permits Supply-Chain Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–33
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumVulnerable Code
yaml "bins": ["bimdown"], "install": { "npm": "bimdown-cli" }markdown 1. **Check first**: Run `which bimdown` (or `bimdown --version`). If it exists, skip the install step. 2. **If missing**: Install via npm — but you **MUST explicitly ask the user for permission** before running `npm install -g` autonomously. This writes to global npm paths and executes arbitrary package scripts, so it is a privileged action. ```bash npm install -g bimdown-clitext ### Technical Analysis The Skill directs the agent to install the latest available release of `bimdown-cli` from npm without an exact version, lockfile, or integrity hash. Because npm dependencies and lifecycle scripts can execute code during installation, the effective code installed by this instruction may change after the Skill has been audited. Requiring user permission appropriately acknowledges the privileged nature of the operation, but consent does not establish package integrity. If the package, its publisher account, or a transitive dependency is compromised, a malicious release can run under the privileges of the user performing the installation. The global installation scope also modifies shared executable paths rather than isolating the dependency within a project. No evidence establishes that the current `bimdown-cli` package is malicious. The confirmed weakness is the mutable, unverified dependency installation process. ### Attack Path 1. An attacker compromises the npm publisher account, the package itself, or one of its installation-time dependencies. 2. The attacker publishes a malicious release under the existing `bimdown-cli` package name. 3. On a system where `bimdown` is absent, the Skill asks for installation permission as documented. 4. Aft ...[truncated 1033 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
bimdown-clito an exact, reviewed version rather than resolving the mutable latest release:bash npm install --save-exact bimdown-cli@<reviewed-version> - Prefer a project-local installation and invoke it through a controlled local path instead of modifying global executable locations.
- Commit and enforce a lockfile containing resolved transitive dependency versions and integrity metadata.
- Verify the package provenance, publisher identity, source repository, and registry integrity before installation.
- Where compatible with the package, disable npm lifecycle scripts during installation using
--ignore-scripts; separately run only explicitly reviewed setup steps. - Execute installation and CLI operations in a sandbox or least-privileged environment with access limited to the required project directory.
- Document a tested version upgrade process requiring security review before changing the pinned version or lockfile.
- Retain the existing explicit-consent requirement, but disclose the exact version, source, global or local installation scope, and lifecycle-script behavior in the consent request.
- Pin
