T08 · Insecure Dependencies
Warning
- Location
- package.json:15
- Finding
- Non-Reproducible Dependencies and Unpinned Package Execution<![CDATA[ ## Vulnerability Details **File Location**: `package.json:15-18`, `package-lock.json:2-19`, `SKILL.md:28` **Vulnerability Type**: Supply-chain exposure caused by inconsistent dependency metadata and unpinned `npx` execution **Risk Level**: Medium ### Vulnerable Code `package.json:15-18`: ```json "clawhub:login": "npx clawhub login", "clawhub:publish": "npx clawhub publish ./ --slug 31third-safe-rebalancer-simple --name \"31Third Safe Rebalancer (Simple)\" --version 0.2.0 --tags latest" }, "dependencies": { "@31third/sdk": "0.2.2", ``` `package-lock.json:2-19`: ```json "name": "@31third/safe-rebalancer-simple", "version": "0.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@31third/safe-rebalancer-simple", "version": "0.1.5", "license": "MIT", "dependencies": { "@31third/sdk": "0.1.3", "ethers": "^6.15.0" }, "devDependencies": { "typescript": "^5.7.3", "vitest": "^2.1.8" } }, "node_modules/@31third/sdk": { "version": "0.1.3", ``` `SKILL.md:28`: ```bash npm install ``` ### Technical Analysis The dependency manifest and lockfile do not describe the same dependency graph. `package.json` declares project version `0.2.0` and requires `@31third/sdk` version `0.2.2`, while `package-lock.json` records project version `0.1.5` and SDK version `0.1.3`. Consequently, the documented `npm install` process may modify the lockfile and download SDK code that is not covered by the audited lockfile's integrity record. This prevents deterministic installation and means the installed implementation may differ from the implementation represented during source review. The login and publishing scripts also invoke `npx clawhub` without an exact version. If the package is not already available locally, `npx` may download and execute the package version selected by the registry at invocation time. This creates a mutable remote-code execution boundary in maintainer workflows. No e ...[truncated 1577 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Regenerate `package-lock.json` from the current `package.json` and commit the resulting lockfile. 2. Confirm that the root package version and `@31third/sdk` version agree across both files. 3. Review the resolved SDK release and verify its registry integrity before accepting the regenerated lockfile. 4. Replace the documented installation command with: ```bash npm ci ``` 5. Configure CI to fail when `npm ci` detects that the manifest and lockfile are inconsistent. 6. Pin the ClawHub CLI to an exact reviewed version, for example: ```json "clawhub:login": "npx --yes clawhub@<reviewed-version> login", "clawhub:publish": "npx --yes clawhub@<reviewed-version> publish ./ ..." ``` 7. Prefer adding the ClawHub CLI as an exact-version development dependency so its version and integrity are recorded in `package-lock.json`. 8. Run publishing operations from an isolated, minimally privileged environment with short-lived credentials. ]]>
