T08 · Insecure Dependencies
Warning
- Location
- package-lock.json:22
- Finding
- Dependencies Are Locked to an Unencrypted Third-Party Package Mirror<![CDATA[ ## Vulnerability Details **File Location**: `package-lock.json:22-26` and equivalent `resolved` entries throughout `package-lock.json` **Vulnerability Type**: Insecure dependency source **Risk Level**: Medium ### Vulnerable Code ```json "node_modules/@pinojs/redact": { "version": "0.4.0", "resolved": "http://mirrors.tencentyun.com/npm/@pinojs/redact/-/redact-0.4.0.tgz", "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==" } ``` The same unencrypted mirror is used for the other direct and transitive dependencies in the lockfile. ### Technical Analysis The lockfile retrieves dependency archives over plain HTTP from a third-party mirror. HTTP does not authenticate the package server and does not protect package downloads from interception or modification in transit. The SHA-512 integrity fields substantially reduce direct package-substitution risk when the lockfile is trusted and the package manager correctly enforces integrity verification. However, the source remains unauthenticated, exposes dependency requests to network observers, permits denial-of-service or downgrade interference, and becomes a code-execution risk if the lockfile is also modified, integrity checking is bypassed, or the installation workflow accepts regenerated metadata from the compromised mirror. Because dependency code executes with the permissions of the installation and Skill runtime, dependency-source trust is part of the security boundary. ### Attack Path 1. A developer or deployment system runs `npm install` or `npm ci`. 2. The package manager requests archives from `http://mirrors.tencentyun.com`. 3. An attacker with network-path or mirror control intercepts or disrupts the HTTP response. 4. With an unchanged trusted lockfile and enforced integrity checking, unauthorized replacement should fail verification, resulting primarily in installation failure. 5. If the attacker can also alter or regenerate t ...[truncated 622 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Configure npm to use an authenticated HTTPS registry, preferably `https://registry.npmjs.org/` or an organization-controlled HTTPS artifact repository. 2. Delete and regenerate `package-lock.json` using the trusted HTTPS registry. 3. Verify that every `resolved` dependency URL uses HTTPS. 4. Use `npm ci` in CI and production so the reviewed lockfile is not silently regenerated. 5. Keep integrity verification enabled and reject installation when a package hash differs. 6. Restrict lockfile modifications through code review and protected branches. 7. Consider dependency provenance verification, automated vulnerability scanning, and an internally approved package allowlist. ]]>
