T08 · Insecure Dependencies
- Location
package-lock.json:21- Finding
Dependencies Are Retrieved from a Third-Party npm Registry Mirror
- Content
View full analysis
Vulnerability Details
File Location:
package-lock.json:21-31
Vulnerability Type: Third-party dependency source trust
Risk Level: Mediumjson "node_modules/axios": { "version": "1.13.6", "resolved": "https://registry.npmmirror.com/axios/-/axios-1.13.6.tgz", "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.11", "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }Technical Analysis
The lockfile resolves
axiosand its transitive dependencies throughregistry.npmmirror.com, a third-party npm registry mirror, rather than the officialregistry.npmjs.orgregistry. This adds another trust boundary to the dependency installation process.The recorded SHA-512 integrity values provide meaningful protection against an artifact being changed without a corresponding lockfile update. However, they do not eliminate risks arising from a compromised mirror and lockfile-generation workflow, a malicious artifact already represented by the lockfile, or differences in package provenance and availability.
The audit found no evidence that the currently locked packages are malicious, and no dependency lifecycle scripts were identified in the supplied lockfile. The issue is therefore a supply-chain hardening concern rather than proof of active compromise.
Attack Path
- An attacker compromises the configured third-party registry mirror, its upstream synchronization process, or the environment used to generate the lockfile.
- A malicious or substituted dependency artifact is selected and a matching lockfile integrity value is introduced, or installation occurs without enforcing the reviewed lockfile.
- A developer or deployment system installs dependencies from the mirror.
- Malicious dependency code executes through an installation lifecycle ...[truncated 822 chars]
- Remediation
View remediation
Remediation Suggestions
- Configure npm to use the official registry:
bash npm config set registry https://registry.npmjs.org/ - Remove and regenerate the lockfile in a controlled environment:
bash rm -rf node_modules package-lock.json npm install - Review the regenerated dependency versions and integrity hashes before committing the lockfile.
- Use
npm ciin CI and production so installation strictly follows the reviewed lockfile. - Prevent registry overrides through unreviewed project, user, or CI
.npmrcfiles. - Run dependency vulnerability and provenance checks during CI, such as
npm audit, software composition analysis, and package-signature or provenance verification where supported. - Restrict installation and runtime environments through non-root execution, minimal filesystem access, limited environment secrets, and outbound network controls.
- Consider pinning the direct dependency to an exact reviewed version instead of the broad
^1.6.0range used inpackage.json.
- Configure npm to use the official registry:
