T08 · Insecure Dependencies
- Location
package-lock.json:1744- Finding
Dependency Installation Uses a Third-Party Package Registry
- Content
View full analysis
Vulnerability Details
File Location:
package-lock.json:1744-1749
Vulnerability Type: Supply-chain exposure through a non-official package registry and an installation lifecycle script
Risk Level: MediumVulnerable Code
json "node_modules/esbuild": { "version": "0.25.0", "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.0.tgz", "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", "hasInstallScript": true, "license": "MIT",The documented installation command that activates dependency installation appears at
SKILL.md:44-48:bash npm installTechnical Analysis
The lockfile directs npm to download
esbuildfromregistry.npmmirror.com, a third-party registry rather than the official npm registry. Numerous other lockfile entries use the same source. Integrity hashes protect against an artifact differing from the version recorded in the lockfile, but they do not eliminate the risk of a malicious lockfile update or a situation where both the artifact and its recorded hash are compromised.The exposure is more significant for
esbuildbecause the package is marked withhasInstallScript: true. npm may execute its lifecycle installation logic duringnpm install, giving downloaded package code access to the installing user's filesystem, environment, and network permissions. The audit did not establish that the current mirrored artifact or its installation script is malicious; the issue is the avoidable supply-chain trust placed in a non-official distribution source.Attack Path
- An attacker compromises the third-party registry, its publishing pipeline, or a future lockfile update.
- A malicious package artifact and corresponding integrity value are introduced.
- A user follows
SKILL.mdand runsnpm install. - npm downloads the package from the third-party registry.
- Th ...[truncated 673 chars]
- Remediation
View remediation
Remediation Suggestions
- Regenerate
package-lock.jsonusing the official npm registry:bash npm config set registry https://registry.npmjs.org/ rm -rf node_modules package-lock.json npm install - Review the regenerated lockfile and confirm that every
resolvedpackage URL points to an approved registry. - Use
npm ciin automated environments so installation strictly follows the reviewed lockfile. - Pin reviewed dependency versions rather than relying on broad ranges where reproducibility is important.
- Retain and verify package integrity hashes.
- Use
npm ci --ignore-scriptsin environments where lifecycle scripts are unnecessary. If scripts are required, explicitly inventory and review packages that execute them. - Apply registry allow-listing and outbound network restrictions in CI to prevent unapproved package sources.
- Run dependency installation in an isolated, least-privileged build environment without production credentials.
- Regenerate
