T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:30
- Finding
- Unpinned Third-Party Wallet Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:30`; duplicate installation guidance appears in `references/overview.md:134-141` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code ```markdown **Install:** `npm install @x402/core @x402/evm` ``` The corresponding installation instructions in `references/overview.md` are: ```bash npm install @x402/core @x402/evm ``` ```bash yarn add @x402/core @x402/evm ``` ### Technical Analysis The Skill instructs users to install `@x402/core` and `@x402/evm` without specifying exact reviewed versions, a lockfile, integrity hashes, or package provenance requirements. The packages subsequently operate in the same process that receives wallet signing material through `WALLET_PRIVATE_KEY`. Because the commands resolve package versions from the npm registry at installation time, the code installed by a user can differ from the code that existed when the Skill was reviewed. A compromised maintainer account, malicious future release, registry compromise, or dependency-chain compromise could therefore introduce arbitrary installation or runtime behavior. This is a supply-chain weakness rather than evidence that the named packages are currently malicious. ### Attack Path 1. An attacker compromises a package maintainer, release process, registry account, or transitive dependency. 2. The attacker publishes a malicious release under a version range accepted by the unpinned installation command. 3. A user follows the Skill and runs `npm install @x402/core @x402/evm` or the equivalent Yarn command. 4. The package executes malicious lifecycle or runtime code with the privileges of the application process. 5. When the application constructs the payment client, malicious code may inspect environment variables, modify payment behavior, or transmit signing material. 6. The attacker can then abuse any credentials or process-level access obtained by the compromised package. ### I ...[truncated 661 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin both direct dependencies to exact, reviewed versions rather than accepting the latest compatible release. 2. Include and verify a committed lockfile, and recommend reproducible installation with `npm ci`. 3. Verify package provenance, signatures, registry ownership, and published integrity metadata before installation. 4. Audit direct and transitive dependencies with an appropriate software-composition analysis tool. 5. Disable package lifecycle scripts during installation where compatible with the packages: ```bash npm ci --ignore-scripts ``` 6. Run the payment client in a dedicated, least-privileged process or container with minimal filesystem and network access. 7. Do not expose a general-purpose wallet key directly to the dependency. Prefer a constrained external signer that enforces network, token, recipient, and amount policies. 8. Establish a controlled upgrade process in which new dependency versions are reviewed and tested before deployment. ]]>
