T08 · Insecure Dependencies
- Location
SKILL.md:21- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 21-25
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: Mediummarkdown ## 🛠️ 安装依赖 ```bash npm install -g @libtv/skillstext ### Technical Analysis The installation instructions retrieve the latest available version of `@libtv/skills` from the configured npm registry and install it globally without specifying an audited version or integrity value. Because npm package versions are mutable from the consumer's perspective when no version is pinned, the code installed by future users may differ from the code originally reviewed. npm installation may execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. A compromised package release, publisher account, registry response, or dependency could therefore execute arbitrary code during installation. Global installation also places the package's executable entry points in a shared command location, increasing the consequences of package compromise. The repository contains only `SKILL.md`; the source code and package metadata for `@libtv/skills` are not included. Consequently, the package's lifecycle scripts, transitive dependencies, authentication handling, upload behavior, and CLI execution paths could not be audited. ### Attack Path 1. An attacker compromises the npm publisher account, the package itself, a transitive dependency, or the package distribution channel. 2. The attacker publishes a malicious release of `@libtv/skills` or causes a malicious dependency to be resolved. 3. A user follows the documented command without selecting a known, reviewed version. 4. npm resolves and downloads the attacker-controlled release. 5. Malicious lifecycle scripts execute during installation, or malicious code executes when the user later invokes the globally installed `libtv` command. 6. The payload operates with the privileges and environment ...[truncated 874 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an explicitly reviewed version, for example:
bash npm install --global @libtv/skills@<reviewed-version> - Publish and verify package provenance, including the official npm scope, publisher identity, source repository, release signatures, and build provenance.
- Provide integrity hashes or a signed release-verification procedure for distributed artifacts.
- Audit package lifecycle scripts and transitive dependencies before recommending installation.
- Prefer a project-local installation or an isolated execution environment over global installation where feasible.
- Advise users not to run the installation command with administrative privileges.
- Use lockfiles and automated dependency scanning in the package's source repository to constrain and continuously assess transitive dependencies.
- Include the actual package source or a verifiable reference to the exact audited revision so reviewers can inspect credential handling, file access, network behavior, and command execution.
- Pin the dependency to an explicitly reviewed version, for example:
