T08 · Insecure Dependencies
Warning
- Location
- package-lock.json:18
- Finding
- Dependencies Are Locked to a Third-Party npm Mirror## Vulnerability Details **File Location**: `package-lock.json:18-31`; related registry configuration in `开发记录.md:29-30`; automatic installation path in `start.sh:18-21` **Vulnerability Type**: Supply-chain exposure through a non-default dependency source **Risk Level**: Medium ### Vulnerable Code `package-lock.json:18-31`: ```json "node_modules/@hono/node-server": { "version": "1.19.11", "resolved": "https://registry.npmmirror.com/@hono/node-server/-/node-server-1.19.11.tgz", "integrity": "sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==", "license": "MIT", "engines": { "node": ">=18.14.1" }, "peerDependencies": { "hono": "^4" } }, "node_modules/@modelcontextprotocol/sdk": { "version": "1.27.1", "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz", "integrity": "sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==", ``` `开发记录.md:29-30`: ```bash npm config set registry https://registry.npmmirror.com npm install @modelcontextprotocol/sdk zod ``` The same third-party host is used for the remaining dependency archive URLs throughout `package-lock.json`. ### Technical Analysis The lockfile directs npm to retrieve dependency archives from `registry.npmmirror.com` rather than the official npm registry. The development documentation also recommends changing npm's persistent registry configuration to that mirror. This expands the installation trust boundary beyond the package authors and official npm infrastructure. The project startup wrapper invokes `npm install` when `node_modules` is absent. Consequently, first-time startup may initiate network retrieval of the locked packages without a separate dependency-review step. SHA-512 integrity values are present, which materially reduce substitution risk: npm should reject an archive whose conten ...[truncated 2468 chars]
- Remediation
- ## Remediation Suggestions 1. Regenerate `package-lock.json` using the official npm registry: ```bash npm config set registry https://registry.npmjs.org/ rm -rf node_modules package-lock.json npm install ``` 2. Review the regenerated dependency tree and commit the new lockfile only after verifying that every `resolved` package URL uses the intended official registry. 3. Remove the recommendation to persistently change the user's npm registry from `开发记录.md`. If a mirror must be offered for regional availability, document it as an explicit optional choice with its trust implications. 4. Use deterministic installation in automation and startup workflows: ```bash npm ci --ignore-scripts ``` Confirm compatibility before disabling lifecycle scripts. 5. Avoid silently installing dependencies as part of server startup. Separate installation from execution so users can review the network operation before launching the Skill. 6. Pin direct dependencies to exact reviewed versions rather than caret ranges: ```json { "dependencies": { "@modelcontextprotocol/sdk": "1.27.1", "zod": "4.3.6" } } ``` 7. Enable automated dependency vulnerability and provenance checks, and require review for any lockfile or registry-source change.
