T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:26
- Finding
- Unpinned Third-Party Packages Create a Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 26–28 **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm install @x402/fetch @x402/evm ``` ### Technical Analysis The installation instructions do not specify exact versions of `@x402/fetch` or `@x402/evm`. No lockfile or package integrity hashes are included in the audited project. Consequently, following these instructions resolves whichever package versions and transitive dependencies the configured npm registry currently serves rather than a version reviewed with this Skill. This is particularly sensitive because these packages are subsequently imported to wrap network requests and authorize x402 payments using an EVM wallet. A compromised, malicious, or unexpectedly changed package release could execute code through npm lifecycle scripts during installation or through imported package logic at runtime. The reviewed content does not establish that either named package is currently malicious. The vulnerability is the mutable and insufficiently verified dependency installation process. ### Attack Path 1. An attacker compromises the publisher account, registry distribution channel, or a transitive dependency associated with one of the named packages. 2. The attacker publishes a malicious package version that satisfies the unbounded installation command. 3. A user or agent follows the Skill instructions and runs `npm install @x402/fetch @x402/evm`. 4. npm resolves and installs the attacker-controlled release because no reviewed version, lockfile, or integrity constraint is enforced. 5. Malicious code executes through an installation lifecycle script or when the package is imported. 6. The code operates with the privileges of the user running npm or the agent process and may interfere with wallet-backed payment operations, network requests, or locally accessible data. ### Impact Assessment Successful exploitation could ...[truncated 879 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin each direct dependency to a reviewed exact version rather than relying on the latest registry release: ```bash npm install --save-exact @x402/fetch@<reviewed-version> @x402/evm@<reviewed-version> ``` 2. Commit a generated `package-lock.json` and instruct users to install reproducibly with `npm ci`. 3. Verify lockfile integrity entries and review all transitive dependencies before release. 4. Audit dependency lifecycle scripts and consider installing with `--ignore-scripts` when lifecycle execution is unnecessary. 5. Use automated dependency scanning and controlled update workflows. Review package ownership, release provenance, and code changes before changing pinned versions. 6. Run wallet and payment functionality in an isolated, least-privileged process with strict transaction limits, network allowlisting, and explicit payment authorization. 7. Document the expected npm registry and reject unexpected registry overrides or similarly named packages. ]]>
