T08 · Insecure Dependencies
Warning
- Location
- references/webpush.md:6
- Finding
- Unpinned Third-Party npm Dependency Installation<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:104` - `references/webpush.md:6` - `references/webpush.md:130` **Vulnerability Type**: Unpinned and globally installed third-party dependency **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:104` and `references/webpush.md:130`: ```bash npm install web-push -g ``` `references/webpush.md:6`: ```bash npm install web-push --save ``` ### Technical Analysis The installation instructions identify `web-push` only by package name and do not pin a reviewed version or enforce a lockfile and integrity metadata. Consequently, the package version retrieved when a user follows the instructions can change after this Skill has been reviewed. npm packages can run lifecycle scripts during installation and execute application code when imported. If a future package release, transitive dependency, maintainer account, or registry resolution path is compromised, following these instructions could execute unreviewed code with the privileges of the installing user. The global installation form further expands exposure by placing an executable in the user's global npm environment. No evidence establishes that the named package is currently malicious; the risk arises from mutable dependency resolution and insufficient supply-chain controls. ### Attack Path 1. An attacker compromises the package publisher, a transitive dependency, or another relevant part of the package distribution chain. 2. The attacker publishes a malicious version containing an installation lifecycle script or modified runtime/CLI behavior. 3. A user follows the documented unversioned `npm install web-push` instruction. 4. npm resolves and downloads the malicious release because no reviewed version or lockfile is enforced. 5. Malicious lifecycle code executes during installation, or malicious behavior executes when the package or global CLI is subsequently used. ### Impact Assessment Successful exploitation could execute arbit ...[truncated 383 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin `web-push` to a specifically reviewed version rather than resolving an unrestricted current release. - Install the package locally instead of globally wherever possible. - Generate and commit a package lockfile, then require reproducible installation through `npm ci`. - Review lockfile changes and dependency provenance before upgrades. - Use npm registry integrity metadata and automated dependency vulnerability scanning. - Consider disabling lifecycle scripts during initial inspection with `npm ci --ignore-scripts`, where compatible, and explicitly review any scripts before allowing them. - Replace the global CLI example with a locally pinned invocation, such as an npm script or `npx --no-install`, so it cannot silently fetch a different package version. ]]>
