T08 · Insecure Dependencies
- Location
README.md:45- Finding
Unpinned Global Installation of a Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Locations:
README.md:45-48,package.json:31-33
Vulnerability Type: Supply-chain exposure through an unpinned globally installed dependency
Risk Level: MediumRelevant code from
README.md:45-48:bash ### 2. Install dependencies npm install -g mcporterRelevant code from
package.json:31-33:json "peerDependencies": { "mcporter": ">=0.7.0" },Technical Analysis
The installation instructions globally install
mcporterwithout specifying an exact reviewed version. The package metadata reinforces this behavior by accepting every release equal to or newer than version0.7.0.As a result, installation behavior is not reproducible and may change after this Skill has been reviewed. A future package release can introduce new code or npm lifecycle scripts that execute during installation. Because the documented command uses global installation, such scripts execute with the permissions of the user running npm and can modify that user's global package environment.
The project does not include a lockfile or integrity value that would constrain this global installation to a reviewed artifact. No evidence was found that the current
mcporterpackage is malicious; the vulnerability is the uncontrolled trust placed in future accepted releases.Attack Path
- An attacker compromises the upstream
mcporterpackage, its publisher account, or its release process. - The attacker publishes a malicious version satisfying the
>=0.7.0range. - A user follows the documented
npm install -g mcportercommand. - npm resolves and downloads the malicious accepted release rather than a previously reviewed version.
- Malicious package code or lifecycle scripts execute with the installing user's privileges.
- The package can then alter user-accessible files, inspect user-accessible data or environment variables, or compromise later `mcpor ...[truncated 741 chars]
- An attacker compromises the upstream
- Remediation
View remediation
Remediation Suggestions
-
Replace the open-ended installation command with an exact, reviewed version:
bash npm install --global mcporter@0.7.0The selected version should be updated only after review and testing.
-
Change the dependency declaration from an unrestricted lower-bound range to an exact version where platform compatibility permits:
json "peerDependencies": { "mcporter": "0.7.0" } -
Prefer a project-local dependency over global installation, and commit a lockfile generated by the supported npm version.
-
Use npm lockfile integrity metadata or an equivalent artifact-verification mechanism to ensure the downloaded package matches the reviewed release.
-
Document the expected npm registry and publisher identity so users can detect dependency-confusion or registry-substitution scenarios.
-
Install dependencies using an unprivileged account and avoid
sudo npm install -g. -
Review package lifecycle scripts and release changes before updating the pinned version. Where operationally feasible, install with lifecycle scripts disabled and explicitly enable only scripts demonstrated to be required.
-
