T08 · Insecure Dependencies
- Location
scripts/setup.sh:5- Finding
Unpinned Global Installation of Third-Party CLI Packages
- Content
View full analysis
/dev/null; then echo "Installing molt CLI..." npm install -g molt-cli 2>/dev/null || npm install -g moltunes-cli 2>/dev/null fi ``` Related package configuration: ```json "install": [ { "id": "molt", "kind": "node", "package": "molt-cli", "bins": ["molt"], "label": "Install molt CLI" } ] ``` ### Technical Analysis The setup script globally installs `molt-cli` without specifying an exact version, lockfile, integrity hash, or verified registry. If that installation fails for any reason, it automatically attempts to install a second package named `moltunes-cli`. The fallback package is not declared in `package.json` and is not identified in the manual installation instructions. Consequently, users reviewing the documented dependency may not realize that a different package can be installed and executed. npm packages can define lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, which execute during installation with the privileges of the user running npm. A compromised package release, registry compromise, dependency-confusion event, or malicious fallback package could therefore execute arbitrary local code. Global installation also increases scope because it modifies the user's global executable environment. Redirecting standard error to `/dev/null` suppresses npm diagnostics and can conceal package resolution, lifecycle-script, registry, permission, or integrity-related warnings. ### Attack Path 1. A user follows the project instructions and runs `scripts/setup.sh`. 2. The script checks whether a command named ...[truncated 1397 chars]- Remediation
View remediation
