T08 · Insecure Dependencies
- Location
scripts/publish.sh:20- Finding
Automatic Installation of an Unpinned Global npm Package
- Content
View full analysis
/dev/null; then npm install -g @wenyan-md/cli fi ``` ### Technical Analysis The publishing workflow automatically downloads and globally installs `@wenyan-md/cli` when the `wenyan` command is unavailable. The dependency is not pinned to an audited version, and the installation is not protected by a lockfile, package integrity hash, trusted artifact repository, or explicit user approval. Consequently, the effective code executed by the Skill can change after the Skill itself has been reviewed. A compromised npm publisher account, registry compromise, or malicious future package release could introduce arbitrary code through package installation scripts or the installed executable. The global installation scope increases the risk because files may be written outside the project directory. The installation and package lifecycle scripts execute with the privileges of the user running `publish.sh`. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or its dependency chain. 2. The attacker publishes a malicious version under the existing package name. 3. A user invokes `scripts/publish.sh` on a system where `wenyan` is not installed. 4. The script executes `npm install -g @wenyan-md/cli` without a version constraint. 5. npm retrieves the current mutable package version and runs any enabled installation lifecycle scripts. 6. The malicious package executes with the privileges of the invoking account. 7. If the Skill is run by a privileged account, the package may modify globally accessible files, steal credentials available to the process, or compromise the host. ### Impact Assessment Successful exploitation permits arbitrary ...[truncated 335 chars]- Remediation
View remediation
