T08 · Insecure Dependencies
Warning
- Location
- README.md:8
- Finding
- Unpinned Third-Party Package Execution and Dependency Installation## Vulnerability Details **File Location**: `README.md:6-10`, `README.md:37-40` **Vulnerability Type**: Supply-chain risk from mutable, unpinned dependencies **Risk Level**: Medium ### Vulnerable Code ```markdown ## Install ```bash npx skills add kent-x1/sp3nd-agent-skill ``` ``` ```markdown Install the example dependencies: ```bash npm install @solana/web3.js @solana/spl-token @solana/spl-memo dotenv ``` ``` ### Technical Analysis The documented `npx` command does not pin the `skills` package to a specific version or integrity hash. Depending on the local npm configuration and cache state, `npx` may download and execute the currently published version of that package. Its effective code can therefore differ from the version that was originally reviewed. The dependency installation command likewise omits exact versions. The audited project contains no `package.json`, lockfile, integrity metadata, or vendored dependency set that would make dependency resolution reproducible. Consequently, users following the documentation may install package versions published after this audit. This is an insecure dependency-management practice rather than evidence that any currently named package is malicious. Exploitation requires a package, publisher account, distribution channel, or relevant dependency to become compromised or to publish an unsafe update. The risk is amplified by the skill’s intended environment: it uses SP3ND API credentials and a funded Solana wallet. Dependency or installation-time code running in that environment could attempt to access those sensitive resources. ### Attack Path 1. An attacker compromises the publisher account, release process, or dependency chain of the unpinned `skills` package or one of the unpinned payment-example dependencies. 2. The attacker publishes a malicious version under the expected package name. 3. An operator follows the README and runs the unpinned `npx` or `npm ...[truncated 1397 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the executable package to a reviewed version instead of resolving the latest release: ```bash npx --yes skills@<reviewed-version> add kent-x1/sp3nd-agent-skill@<reviewed-commit-or-tag> ``` 2. Add a `package.json` containing exact dependency versions and commit the generated lockfile. Use `npm ci` for reproducible installation rather than an unconstrained `npm install`. 3. Review and commit the referenced `scripts/x402-pay-with-memo.mjs` implementation so its imports, wallet handling, transaction construction, and network destinations can be audited with the skill. 4. Verify package provenance and lockfile integrity in CI. Consider npm provenance attestations, trusted registries, dependency allowlists, and automated supply-chain scanning. 5. Disable dependency lifecycle scripts where they are not required: ```bash npm ci --ignore-scripts ``` If lifecycle scripts are necessary, review each script before enabling it. 6. Run installation and payment tooling under a dedicated, least-privileged operating-system account or isolated container. Do not expose unrelated credentials or files to that environment. 7. Keep the Solana wallet minimally funded, restrict wallet-file permissions, and inject SP3ND credentials only into the process that requires them. 8. Document the exact reviewed versions and hashes so operators can verify that installed artifacts match the audited release.
