T08 · Insecure Dependencies
- Location
SKILL.md:235- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 235
Vulnerability Type: Unpinned and globally installed third-party dependency
Risk Level: MediumVulnerable Code
markdown | markdownlint | Validation tool | Recommended | `npm install -g markdownlint-cli` |The original dependency table recommends executing
npm install -g markdownlint-cliwithout specifying an audited version, lockfile, or package integrity value.Technical Analysis
The installation command resolves the package version from the npm registry at execution time. Consequently, the installed artifact can differ from the artifact that existed when the Skill was reviewed. npm installation may also execute package lifecycle scripts with the permissions of the invoking user.
The global installation flag modifies the user's or system's shared npm environment rather than isolating the dependency within the project. This expands the effect of a compromised, malicious, or unexpectedly changed package release beyond the audited Skill.
The reviewed project does not itself contain a malicious script, retrieve a remote executable payload directly, or prove that
markdownlint-cliis malicious. The risk arises from the unsafe dependency installation guidance.Attack Path
- An attacker compromises the referenced package, one of its transitive dependencies, or the relevant package publishing account.
- The attacker publishes a malicious release containing harmful package code or an installation lifecycle script.
- A user or agent follows the Skill's recommendation and runs
npm install -g markdownlint-cli. - npm resolves the current registry release because no version or integrity constraint is provided.
- Malicious lifecycle code executes with the permissions of the user running npm, and the package is placed in the shared global npm environment.
Impact Assessment
Successful exploitation could execute arbitrary cod ...[truncated 471 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to a specific reviewed version, for example by declaring an exact version in
package.json. - Install it as a project-local development dependency rather than globally:
bash npm install --save-dev --save-exact markdownlint-cli@<reviewed-version> - Commit and enforce a lockfile, then use
npm ciin automated environments to obtain deterministic dependency resolution. - Verify package provenance, maintainers, release history, and transitive dependencies before approving a version.
- Use npm integrity and provenance controls where supported, and regularly audit the locked dependency tree.
- Consider
--ignore-scriptswhen package lifecycle scripts are unnecessary and compatibility has been verified. - Run validation in a restricted environment with minimal filesystem, credential, and network access.
- Do not run dependency installation with administrator or root privileges.
- Pin the dependency to a specific reviewed version, for example by declaring an exact version in
