T08 · Insecure Dependencies
- Location
scripts/init-project.sh:47- Finding
Automatic Installation of Unpinned Dependencies Without a Lockfile
- Content
View full analysis
/dev/null 2>&1; then (cd "$TARGET_DIR" && pnpm install) elif command -v npm >/dev/null 2>&1; then (cd "$TARGET_DIR" && npm install) else echo "No pnpm/npm found. Run install manually in $TARGET_DIR" exit 1 fi ``` ```json "dependencies": { "@coral-xyz/anchor": "^0.32.1", "@solana/web3.js": "^1.98.4", "JSONStream": "^1.3.5", "axios": "^1.18.1", "bs58": "^6.0.0", "dayjs": "^1.11.21", "decimal.js": "^10.6.0", "dotenv": "^17.4.2", "stream-chain": "^3.4.0", "stream-json": "^1.9.1" }, "devDependencies": { "@types/node": "^26.1.1", "tsx": "^4.23.1", "typescript": "^7.0.2" } ``` ### Technical Analysis The scaffolding script automatically invokes `pnpm install` or `npm install`. The project does not ship a lockfile, while direct dependencies use caret version ranges. Consequently, each installation can resolve a different direct and transitive dependency graph. Package installation can run package lifecycle scripts under the privileges of the user running the Skill. If a dependency or transitive dependency is compromised, unexpectedly replaced, or publishes a malicious version allowed by the declared ranges, installation can execute attacker-controlled code before the transaction-fetching workflow begins. The dependency surface is larger than necessary. For example, `axios`, `JSONStream`, `stream-chain`, `stream-json`, `dayjs`, and `decimal.js` are included even though several are not required by the primary Solana pull and parse path. This increases the number of packages and transitive components that must remain trustworthy. ### Attack Path 1. An attacker compromises a permitted direct or transitive package version, or its publisher account. 2. The ...[truncated 988 chars]- Remediation
View remediation
