T08 · Insecure Dependencies
Warning
- Location
- package.json:27
- Finding
- Mutable Dependencies Without an Integrity Lockfile<![CDATA[ ## Vulnerability Details **File Location**: `package.json:27-39` **Vulnerability Type**: Third-party dependency and software supply-chain risk **Risk Level**: Medium ### Vulnerable Code ```json "dependencies": { "@solana/spl-token": "^0.4.0", "@solana/web3.js": "^1.98.4", "argon2": "^0.41.0", "bip39": "^3.1.0", "bs58": "^6.0.0", "ed25519-hd-key": "^1.3.0" }, "devDependencies": { "@types/node": "^20.11.0", "ts-node": "^10.9.2", "typescript": "^5.3.0" } ``` No package lockfile is present in the supplied project. ### Technical Analysis Every declared dependency uses a caret version range. These ranges permit npm to install later compatible releases that were not necessarily present when this artifact was created or audited. The absence of `package-lock.json`, `npm-shrinkwrap.json`, or another integrity-bearing lockfile also leaves transitive dependency versions and integrity hashes unspecified. The installation instructions direct users to run `npm install`, and the skill documentation states that dependencies may be installed automatically. An installation can therefore resolve code that differs from the code reviewed during the audit. This is especially sensitive for a cryptocurrency wallet package because its dependencies are intended to participate in cryptographic key derivation, wallet encryption, Solana RPC communication, and token transactions. The native `argon2` package also increases exposure to package installation and native build behavior. This finding does not establish that any currently named dependency is malicious. The vulnerability is the inability to reproduce and integrity-check the dependency graph, which creates a supply-chain attack opportunity if a package publisher, maintainer account, registry response, or transitive component is compromised. ### Attack Path 1. A user follows the documented installation process and runs `npm install`, or the surrounding skill framework installs missing dependencies ...[truncated 1522 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Generate and commit an integrity-bearing `package-lock.json` using a trusted npm version. 2. Use `npm ci` in installation, build, test, and deployment workflows so the dependency graph matches the reviewed lockfile. 3. Pin security-sensitive direct dependencies to explicitly reviewed versions rather than permitting unreviewed updates through caret ranges. 4. Review and continuously scan both direct and transitive dependencies with tools such as `npm audit` and a maintained software composition analysis service. 5. Disable package lifecycle scripts where they are unnecessary, for example by using `npm ci --ignore-scripts`, and explicitly allow only packages whose installation scripts are required and reviewed. 6. Build in a restricted environment without wallet secrets, production credentials, or unnecessary filesystem permissions. 7. Produce reproducible release artifacts and publish provenance, checksums, and a software bill of materials. 8. Include the advertised source and compiled files in the reviewable package so dependency usage, wallet-secret handling, and transaction behavior can be audited before release. ]]>
