T08 · Insecure Dependencies
- Location
SKILL.md:67- Finding
Unpinned Global PM2 Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 67
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumComplete Code Snippet:
powershell npm install -g pm2Technical Analysis
The setup instructions install PM2 globally without specifying a reviewed version or verifying package integrity. Consequently, the dependency resolved at installation time may differ from the version originally assessed. npm packages can also run lifecycle scripts during installation with the permissions of the invoking user.
This creates a supply-chain risk if a future PM2 release, its dependency tree, or the package distribution channel is compromised. The audit found no evidence that PM2 is currently malicious; the issue is the mutable and insufficiently verified installation process.
Attack Path
- An attacker compromises a future PM2 package release, a transitive dependency, or the package distribution channel.
- A user follows the documented setup command.
- npm resolves and downloads the mutable latest PM2 release because no version is pinned.
- Malicious package content or lifecycle scripts execute with the invoking user's permissions.
- The payload can access resources available to that user and potentially interfere with globally managed Node.js processes.
Impact Assessment
Successful exploitation could provide arbitrary code execution under the account running the installation. The affected scope may include that user's files, environment variables, npm configuration, and PM2-managed processes. If the command is run from an elevated shell, the impact could extend to administrative resources and system-wide Node.js tooling. No privilege escalation mechanism beyond the invoking account's existing permissions is demonstrated by the reviewed file.
- Remediation
View remediation
Remediation Suggestions
- Pin PM2 to a specifically reviewed version, for example
npm install -g pm2@<reviewed-version>. - Obtain the package only from an explicitly trusted npm registry and document the expected registry configuration.
- Verify package provenance and integrity before deployment.
- Review the selected release and its transitive dependencies, including installation lifecycle scripts.
- Prefer a reproducible, lockfile-backed deployment mechanism where operationally practical instead of resolving the latest global package dynamically.
- Run installation with the least-privileged account necessary and avoid an elevated shell unless explicitly required.
- Establish a controlled update process that reviews and tests new PM2 versions before changing the pinned version.
- Pin PM2 to a specifically reviewed version, for example
