T08 · Insecure Dependencies
- Location
SKILL.md:325- Finding
Execution of Unpinned npm Packages Through Mutable latest Tags
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:325references/spec-driven-testing.md:27-30
Vulnerability Type: Unpinned third-party package execution
Risk Level: MediumVulnerable Code:
bash npm install -g @playwright/cli@latestbash # If there is no Playwright install, bootstrap one and let the user pick the defaults: npm init playwright@latestTechnical Analysis
Both commands resolve the mutable npm
latestdistribution tag rather than a reviewed, exact package version.npm install -g @playwright/cli@latestdownloads and globally installs whichever release currently owns the tag. Installation can execute package lifecycle scripts with the privileges of the invoking user. Because the installation is global, a compromised package may also modify globally available executables or files outside the project workspace.npm init playwright@latestdownloads and executes the currently published Playwright initializer. The initializer can create files, modify project configuration, and introduce additional dependencies. The instructions do not require a lockfile, integrity validation, provenance checking, lifecycle-script review, or an exact version.These commands are legitimate installation mechanisms, and the audit found no evidence that the currently referenced packages are malicious. The vulnerability is the unsafe trust placed in future, mutable package releases.
Attack Path
- An attacker compromises the npm publisher account, package release process, or a transitive dependency.
- The attacker publishes a malicious release and causes the mutable
latesttag to resolve to it. - A user or agent follows the Skill instructions and runs one of the affected commands.
- npm downloads the changed package without enforcing a previously reviewed version.
- Malicious initializer or lifecycle code executes with the invoking user's privileges.
- The payload m ...[truncated 798 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace mutable tags with reviewed exact versions, for example:
bash npm install --save-dev --save-exact @playwright/cli@REVIEWED_VERSION npm init playwright@REVIEWED_VERSION -
Prefer project-local dependencies over global installation to limit the affected scope and make dependency resolution reproducible.
-
Commit an npm lockfile and use
npm ciin automated environments. -
Validate package provenance, integrity metadata, publisher identity, and lifecycle scripts before approving version upgrades.
-
Consider initially installing with lifecycle scripts disabled where compatible:
bash npm install --ignore-scripts --save-dev --save-exact @playwright/cli@REVIEWED_VERSIONAny required scripts should be reviewed before being run separately.
-
Execute package installation in a restricted, non-privileged environment with minimal filesystem access and without unnecessary credentials.
-
Use automated dependency scanning and an explicit update-review process rather than automatically tracking
latest.
-
