T08 · Insecure Dependencies
- Location
SKILL.md:169- Finding
Unpinned and Unused Global npm Package Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:169
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumVulnerable Code
markdown - 如需预览渲染功能,用户需手动安装:`npm install -g @aspect-ratio/preview-renderer`(本 skill 不会自动安装任何包)The instruction tells users to run:
bash npm install -g @aspect-ratio/preview-rendererTechnical Analysis
The documentation recommends installing a third-party npm package globally without pinning a reviewed version or verifying package integrity. npm will consequently resolve whichever release is current when the command is executed.
Package installation may execute npm lifecycle scripts with the permissions of the invoking user. Because the installation is global, it also modifies the user's shared Node.js environment rather than an isolated project environment.
No reviewed project script imports or invokes
@aspect-ratio/preview-renderer. The implemented preview workflow directly invokes a Chrome executable throughscripts/chrome-utils.mjs. The recommended package therefore creates unnecessary supply-chain exposure and does not correspond to the implementation reviewed during this audit.Attack Path
- A user follows the documented preview-rendering prerequisite.
- npm resolves the current release of
@aspect-ratio/preview-rendererbecause the command specifies neither a version nor an integrity hash. - npm downloads the package and its transitive dependencies.
- Any permitted installation lifecycle scripts execute with the user's npm permissions.
- If the package, a maintainer account, or a transitive dependency has been compromised, the installation can execute attacker-controlled code.
- The package is installed into the global Node.js environment, increasing its scope and persistence relative to a project-local installation.
Impact Assessment
A compromised package release could execute code with ...[truncated 441 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the global installation instruction because the reviewed preview implementation does not use this package.
-
Document the supported Chrome dependency and the
CHROME_BINconfiguration instead. -
If the package becomes necessary, add it as a project-local dependency rather than a global dependency.
-
Pin an exact reviewed version and commit an appropriate lockfile.
-
Review the package's source, maintainers, transitive dependencies, provenance, and lifecycle scripts before adoption.
-
Disable lifecycle scripts during installation where compatible with the package:
bash npm install --ignore-scripts --save-exact package-name@reviewed-version -
Use package integrity and provenance controls in the release process, and periodically review dependency updates before accepting them.
-
