T08 · Insecure Dependencies
- Location
assets/package-lock.json:13- Finding
Dependency Retrieved from an Unofficial Package Registry Mirror
- Content
View full analysis
Vulnerability Details
File Location:
assets/package-lock.json:13-20
Vulnerability Type: Third-party dependency supply-chain risk
Risk Level: LowVulnerable Code
json "node_modules/lunar-javascript": { "version": "1.7.7", "resolved": "https://registry.npmmirror.com/lunar-javascript/-/lunar-javascript-1.7.7.tgz", "integrity": "sha512-u/KYiwPIBo/0bT+WWfU7qO1d+aqeB90Tuy4ErXenr2Gam0QcWeezUvtiOIyXR7HbVnW2I1DKfU0NBvzMZhbVQw==", "license": "MIT" }The associated installation instruction appears at
SKILL.md:22-26:bash cd <skill directory>/assets npm install # Install dependencies on first use node init-bazi.js node daily-guide.js [YYYY-MM-DD] [--matter=repair-phone]Technical Analysis
The lockfile directs npm to download
lunar-javascriptfromregistry.npmmirror.com, a third-party registry mirror, rather than the canonical npm registry. Both executable scripts subsequently load this dependency throughrequire('lunar-javascript'), so installed dependency code executes with the privileges of the user running the Skill.The SHA-512 integrity value substantially mitigates mirror-only artifact substitution: npm should reject a downloaded archive whose content does not match the recorded hash. Nevertheless, relying on an unofficial distribution endpoint expands the supply-chain trust boundary. A malicious or compromised project update that changes both the
resolvedURL and integrity value could cause users following the documented installation process to install modified code.No evidence was found that the currently locked
lunar-javascriptartifact is malicious. This finding concerns the unsafe dependency source and associated supply-chain exposure.Attack Path
- An attacker compromises the third-party mirror or causes a malicious lockfile update to be distributed.
- For a modified artifact to pass npm integrity verification, the distributed l ...[truncated 1192 chars]
- Remediation
View remediation
Remediation Suggestions
- Regenerate
package-lock.jsonusing the canonical npm registry:bash npm config set registry https://registry.npmjs.org/ rm package-lock.json npm install --package-lock-only - Review the regenerated lockfile and verify that every
resolvedURL uses an approved registry. - Pin the dependency to an exact reviewed version in
package.json, rather than using a compatible-version range:json "lunar-javascript": "1.7.7" - Change installation documentation to recommend
npm ci, which installs exactly the dependency graph recorded in the lockfile:bash npm ci - Retain npm integrity hashes and validate lockfile changes during code review.
- Add CI policy checks that reject dependencies resolved from unapproved registries.
- Where practical, generate and review a software bill of materials and run dependency vulnerability scanning before release.
- Regenerate
