Mar 7, 2026·4 min read·17 visits
The Coinbase x402 SDK contains a critical flaw in its Solana payment verification logic. Attackers can spoof payment signatures to bypass fees for APIs and services using the protocol. This affects versions prior to 2.6.0 (npm), 2.3.0 (Python), and 2.5.0 (Go). Immediate upgrade is required for all facilitators.
A critical vulnerability exists in the Coinbase x402 SDK affecting the verification of Solana (SVM) payments. The flaw is located in the facilitator component, which acts as an intermediary for validating automated HTTP 402 payments. Due to improper verification of Ed25519 cryptographic signatures in the Solana implementation, an attacker can bypass payment requirements. This allows unauthorized access to monetized APIs, compute resources, or digital goods without settling the required transaction on the blockchain. The vulnerability specifically affects the `@x402/svm` npm package, the `x402` PyPI package, and the Go SDK.
The x402 protocol is designed to implement the HTTP 402 "Payment Required" status code, facilitating automated, machine-to-machine payments for AI agents and API monetization. A critical component of this architecture is the facilitator, a service responsible for intercepting payment claims, verifying on-chain settlement, and issuing cryptographic proofs to the resource server.
This vulnerability (GHSA-qr2g-p6q7-w82m) resides specifically in the Solana Virtual Machine (SVM) implementation of the facilitator. Unlike the EVM implementations which use ECDSA, the Solana integration utilizes Ed25519 signatures. The flaw allows an attacker to submit a malformed or replayed PAYMENT-SIGNATURE that the facilitator incorrectly accepts as valid. Consequently, the facilitator issues a valid payment token to the resource server, granting the attacker access to the protected resource without an actual transfer of funds.
The root cause is an Improper Verification of Cryptographic Signature (CWE-347) within the SDK's payment validation logic. Specifically, the issue stems from how the facilitator validates the authenticity and uniqueness of Solana transaction signatures provided in the HTTP headers.
In the vulnerable versions, the validation routine for the PAYMENT-SIGNATURE header lacks sufficient checks to ensure the signature is both valid for the specific payload and unique (not a replay). Technical analysis suggests the "auto-sign" feature—intended to streamline developer experience—introduced a code path where the strict cryptographic binding between the payment intent and the on-chain signature was loosened. This allows a signature to be spoofed or an old signature to be reused, tricking the verification logic into returning a success state.
While the exact source code diff is not public in the advisory context, the logical failure can be reconstructed based on the protocol design and the patch description. The vulnerability exists in the VerifySolanaPayment function (or equivalent) within the facilitator.
In a secure implementation, the flow must be:
PAYMENT-SIGNATURE from header.Vulnerable Logic Flow:
// Pseudo-code representation of the flaw
async function verifyPayment(req, context) {
const signature = req.headers['x-payment-signature'];
// VULNERABILITY: The facilitator checks if a signature exists
// but fails to strictly validate it against the specific
// invoice ID or allows replaying a valid signature from a past transaction.
if (isValidFormat(signature)) {
// The system assumes the signature is fresh and valid for THIS request
return grantAccess();
}
return denyAccess();
}Patched Logic Flow: The fix introduces strict validation steps that cryptographically bind the signature to the specific invoice and check for replay attacks against a cache of seen signatures.
An attacker targets a service monetized via x402 (e.g., a Premium LLM API). The service charges 1 USDC per request. The attacker initiates a request, receiving a 402 Payment Required response containing a payment address and invoice ID.
To exploit the system, the attacker crafts a follow-up request containing a spoofed PAYMENT-SIGNATURE header. Because the vulnerable facilitator fails to verify the signature against the Solana blockchain state correctly (or accepts a replayed signature from a 0.0001 USDC test transaction), the facilitator validates the request. The SDK then generates a x402-token which the resource server accepts, returning the premium API response. The attacker effectively consumes the service for free, causing financial loss to the provider.
Severity: Critical (CVSS 9.9)
The impact is primarily financial and integrity-based. Service providers relying on x402 for revenue assurance are at risk of complete monetization bypass. Attackers can drain compute resources, access proprietary data, or utilize paid APIs without cost.
However, it is crucial to note that this vulnerability does not expose private keys or allow the theft of existing user funds held in wallets. The flaw is in the verification of payments, not the custody of funds. The risk is borne entirely by the service provider (merchant) running the vulnerable facilitator.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@x402/svm Coinbase | < 2.6.0 | 2.6.0 |
x402 (PyPI) Coinbase | < 2.3.0 | 2.3.0 |
github.com/coinbase/x402/go Coinbase | < 2.5.0 | 2.5.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-347 |
| CVSS Score | 9.9 (Critical) |
| Attack Vector | Network |
| Exploit Status | PoC Available |
| Affected Protocol | Solana (SVM) |
| Patch Date | 2026-03-07 |