T08 · Insecure Dependencies
- Location
package.json:6- Finding
Mutable npm Dependency Resolution Without a Lockfile
- Content
View full analysis
Vulnerability Details
File Location:
package.json:6-10
Vulnerability Type: Supply-chain risk caused by mutable dependency versions
Risk Level: MediumVulnerable Code
json "dependencies": { "@solana/spl-token": "^0.4.13", "@solana/web3.js": "^1.98.4", "bs58": "^6.0.0", "tweetnacl": "^1.0.3" }The installation instructions in
SKILL.md:48-51direct users to perform a non-reproducible installation:bash cd skills/solana-wallet-rpc npm installTechnical Analysis
All four dependencies use caret version ranges. These ranges permit npm to install newer compatible releases than those visible during this audit. The project also has no committed lockfile, so direct and transitive dependency versions and integrity hashes are not fixed.
Consequently, future installations may execute dependency code that was not part of the reviewed artifact. npm package installation can also invoke lifecycle scripts unless they are explicitly disabled. This is particularly sensitive because the application handles Solana private-key files and signs messages and transactions.
This finding does not establish that any currently declared package is malicious. The vulnerability is the absence of reproducible, integrity-controlled dependency resolution.
Attack Path
- An attacker compromises the npm account, release pipeline, or transitive dependency of a package allowed by the declared version ranges.
- The attacker publishes a malicious version that satisfies one of the caret ranges.
- A user follows the documented
npm installcommand. - npm resolves the malicious direct or transitive package because no lockfile fixes the audited dependency graph.
- Malicious code executes through an installation lifecycle script or when the wallet script imports the package.
- The code runs with the privileges of the user performing installation or invoking the wallet utility and may search for or read wallet files accessible to that account ...[truncated 661 chars]
- Remediation
View remediation
Remediation Suggestions
-
Replace caret ranges with reviewed exact versions, for example:
json "dependencies": { "@solana/spl-token": "0.4.13", "@solana/web3.js": "1.98.4", "bs58": "6.0.0", "tweetnacl": "1.0.3" } -
Generate, review, and commit a
package-lock.jsonso direct and transitive versions and integrity hashes are fixed. -
Change installation documentation from
npm installtonpm ci, which enforces the committed lockfile. -
Use
npm ci --ignore-scriptsif none of the required packages need lifecycle scripts. If scripts are required, review and explicitly allow only necessary scripts. -
Run dependency vulnerability, provenance, and integrity checks in CI.
-
Review lockfile changes as security-sensitive changes and use automated dependency updates with controlled testing rather than unrestricted resolution during installation.
-
Install and run the utility under a least-privileged account with access only to the specific wallet needed for the requested operation.
-
