T08 · Insecure Dependencies
Error
- Location
- scripts/verity.py:60
- Finding
- Unpinned Third-Party SDK Receives a Spend-Capable Wallet Private Key<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:59-63`; `scripts/verity.py:60-67` **Vulnerability Type**: Unpinned security-sensitive dependency **Risk Level**: High ### Vulnerable Code `SKILL.md:59-63`: ```markdown One-time install of the client (the script tells you if it is missing): ```bash pip install "verity-guard[x402]" ``` ``` `scripts/verity.py:60-67`: ```python try: from verity_guard import x402_payer return VerityClient(http=x402_payer(key)) except ImportError: _die(3, INSTALL_HINT) except Exception as e: # bad key, etc. — never echo the key itself _die(1, f"could not build the x402 payer: {type(e).__name__}: {str(e)[:160]}") ``` ### Technical Analysis The documented installation command installs `verity-guard[x402]` without an exact version, lockfile, package hash, or other integrity constraint. The resulting third-party code is then imported into the Python process and passed the raw value of `VERITY_WALLET_KEY`. The local wrapper does not explicitly transmit or log the private key. However, its security guarantee depends on external package code that is not included in this project and was therefore outside the audit scope. Because the dependency is unpinned, a later package release, compromised distribution account, or compromised dependency in the package's transitive dependency graph could change the behavior after this skill has been reviewed. Passing the raw key to `x402_payer(key)` grants that dependency access to the complete private key rather than only to a narrowly scoped signature. A malicious version could copy the key, inspect other process environment variables, or generate signatures beyond the intended payment authorization. ### Attack Path 1. An attacker compromises the upstream package publishing account, package repository, release process, or a relevant transitive dependency. 2. The attacker publishes a malicious version that retains the expected `verity_ ...[truncated 1169 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the client and all security-sensitive transitive dependencies to audited exact versions. 2. Publish a lockfile with cryptographic hashes and install using hash verification, such as: ```bash pip install --require-hashes -r requirements.txt ``` 3. Verify upstream package provenance and signed release artifacts before updating the approved version. 4. Review every dependency update before changing the pin, especially code involved in wallet handling, HTTP transport, and x402 payment authorization. 5. Prefer an isolated signing component that does not disclose the raw private key to the SDK. The SDK should receive only a narrowly scoped authorization or signing interface that enforces the chain, token, recipient, amount, expiration, and nonce. 6. Run the client in a restricted environment with minimal filesystem, environment-variable, and network access. 7. Continue requiring a dedicated low-balance wallet and document explicit balance and allowance limits as defense-in-depth measures. ]]>
