Threat reportVulnerabilityTL-2026-4252
Critical x402 SDK Flaws Could Let Malicious APIs Drain AI Agents' Token Balances (No Default Spend Limit, Solana Approval-as-Payment, Unverified SIWx Domain)
V12 Security reported three critical flaws in the x402 Foundation SDKs (originally created by Coinbase) that could let a malicious paid API drain an AI agent's token balance, bypass payment on Solana, or harvest login signatures for unrelated sites. Fixes shipped 2026-08-18; no CVE or CVSS was assigned and no in-the-wild attacks have been reported.
Key facts
| Identifiers | TL-2026-4252 |
|---|---|
| Also known as | x402 SDK spend-limit flaw, x402 SIWx domain-binding flaw, x402 Solana Approve-as-payment bypass |
| Severity | CRITICAL |
| First disclosed | |
| Affected products | x402 Foundation (originally Coinbase) x402 TypeScript SDK (@x402/core, @x402/svm, @x402/extensions, @x402/fetch, @x402/axios); x402 Foundation (originally Coinbase) x402 Python package (PyPI x402); x402 Foundation (originally Coinbase) x402 Go module (github.com/coinbase/x402/go) |
| Weaknesses (CWE) | CWE-770, CWE-345 |
| Malware | Python |
| MITRE ATT&CK techniques | T1036 Masquerading, T1199 Trusted Relationship, T1550 Use Alternate Authentication Material, T1583 Acquire Infrastructure, T1657 Financial Theft |
| Motivation | UNKNOWN |
| Target sectors | finance, technology, cryptocurrency, ai-agent-platforms |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 12 cited sources |
Detection coverage
As of 2026-10-23, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-4252 across Splunk SPL, Microsoft KQL and Sigma, covering 11 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: x402 SIWx Challenge Signed For Domain Different From 402 Origin
Detects x402 clients that signed a Sign-In-With-X challenge whose domain differs from the host that issued the HTTP 402 response. Pre-fix SDKs (TypeScript, Python, Go before 2026-08-18) signed without domain binding, letting a malicious API relay a challenge for an unrelated site and harvest a valid wallet login signature (alternate authentication material usable against the unrelated site). Fixed clients abort before signing.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1550, T1199, T1036, T1528
- Data sources: x402_agent_logs
- Severity: high
- Confidence: high
Splunk SPL
index=x402 sourcetype="x402:agent:json" event=siwx_signed earliest=-24h
| eval challenge_host=lower(siwx_domain), origin_host=lower(request_host)
| where challenge_host!=origin_host
| stats count as mismatched_signatures values(challenge_host) as challenge_domains dc(challenge_host) as distinct_challenge_domains earliest(_time) as first_seen latest(_time) as last_seen by agent_id wallet_address origin_host
| convert ctime(first_seen) ctime(last_seen)Microsoft KQL
X402Agent_CL
| where TimeGenerated > ago(24h) and event_s == 'siwx_signed'
| extend ChallengeHost = tolower(siwx_domain_s), OriginHost = tolower(request_host_s)
| where ChallengeHost != OriginHost
| summarize mismatched_signatures = count(), challenge_domains = make_set(ChallengeHost, 20), first_seen = min(TimeGenerated), last_seen = max(TimeGenerated) by agent_id_s, wallet_address_s, OriginHostSigma
title: x402 SIWx Message Signed For Domain Not Matching 402 Origin
id: e0a4b836-5f1d-47c9-b2e7-4d83a6c19f05
status: experimental
description: Detects x402 agent log events where a SIWx challenge domain differs from the origin host of the 402 response, indicating cross-site login signature harvesting against a pre-fix x402 SDK.
references:
- https://github.com/x402-foundation/x402/pull/3133
author: Threadlinqs Team
date: 2026-10-23
tags:
- attack.defense-evasion
- attack.t1550
- attack.t1036
- attack.credential-access
- attack.t1528
- attack.initial-access
- attack.t1199
logsource:
category: application
product: x402
service: agent
detection:
selection:
event: 'siwx_signed'
same_origin:
siwx_domain|fieldref: request_host
condition: selection and not same_origin
falsepositives:
- Sites that legitimately delegate authentication to a sibling domain
- Case or subdomain differences between logged fields
level: highKnown false positives:
- Services that legitimately delegate login to a sibling or SSO domain
- Subdomain or case differences between the logged challenge domain and request host
Tuning notes: Requires x402 agent logging of siwx_domain and request_host (field names are assumptions; map to your schema). Normalise to registrable domain if sibling subdomains are legitimate and allowlist approved delegated-auth domains.
- [indicator] SDK Package Installed Or Pinned To Pre-Fix Version On Endpoint · unlock with TL Creds
- [indicator] Agent Wallet Payment Above $1 Default Cap Or In Non-Stablecoin Asset · unlock with TL Creds
- [indicator] Wallet Signs SIWx Challenges For Multiple Domains Via One Origin (Signature Harvesting) · unlock with TL Creds
- [indicator] Solana Exact Scheme Token Approve Instruction Presented As Payment · unlock with TL Creds
- [indicator] Payment Header Sent By Scripted HTTP Client First Seen Against New Paywalled Host · unlock with TL Creds
- [indicator] Patched Client Blocked SIWx Origin Mismatch Or Spend-Limit Violation · unlock with TL Creds
- [indicator] SDK Agent HTTP 402 Payment-Demand Burst With Paid Retries (TL-2026-4252) · unlock with TL Creds
- [indicator] Solana Facilitator Accepted Non-TransferChecked Payment Instruction (Approve-as-Payment Bypass) · unlock with TL Creds
Indicators of compromise
As of 2026-10-23, Threadlinqs Intelligence tracks 11 indicators of compromise for TL-2026-4252.
Technical analysis
x402 is an HTTP-native payment protocol in which a server answers with HTTP 402 Payment Required and the client (frequently an autonomous AI agent) signs a stablecoin payment, typically USDC, and retries the request. The x402 Foundation (a Linux Foundation project; Coinbase created x402 and holds a technical steering committee seat) maintains TypeScript, Python and Go SDKs. V12 Security reviewed the code and validated its findings with local tests only; it sent no live transactions. V12 reportedly identified 25 flaws in total and published details of the three it rated critical.
Flaw 1 - no default spending limit (TypeScript, Python, Go clients). Before the 2026-08-18 releases the default client applied no spending cap. A malicious or compromised API could return a 402 response demanding an arbitrarily large amount in any token, and an agent using the default client would sign it, draining the wallet balance. The fix (TypeScript PR #3124, merged 2026-08-13, with Python #3154 and Go #3156) adds a default cap of $1 USD per payment on recognized pegged assets (stablecoins such as USDC). Non-default assets need explicit opt-in via an allowedAssets list, and the spendControls option can adjust or disable the cap.
Flaw 2 - token approval accepted as payment (Solana, TypeScript only). In @x402/svm 2.0.0-2.22.0 the exact-scheme static validation checked that the instruction at index 2 belonged to the SPL token program but did not check the instruction discriminator. A token Approve instruction, which moves zero tokens, therefore passed as a valid payment, giving a complete payment bypass on the facilitator side. The fix (PR #3132, merged 2026-08-12) adds an explicit data[0] === 12 (TransferChecked) guard, bringing TypeScript in line with the Python and Go implementations, which already had the check. Fixed in @x402/svm 2.23.0 and later.
Flaw 3 - login messages signed without domain verification (SIWx; TypeScript, Python, Go). The automated client signed Sign-In-With-X challenges without confirming that the domain in the message matched the site it was contacting. A malicious API could relay a challenge for an unrelated website and obtain a valid wallet signature for a login there. The fix (TypeScript PR #3133, merged 2026-08-13, with Python #3192 and Go #3193) requires the challenge domain, URI and resources to match the origin of the 402 response URL, and aborts without signing or paying on mismatch. The specification was updated with the SIWx requirement.
Affected: @x402/core, @x402/svm, @x402/extensions, @x402/fetch and @x402/axios 2.0.0-2.22.0 (all fetch/axios/extensions/core releases before the 2026-08-18 fixes), plus the Go module and Python package before the 2026-08-18 releases. Latest versions as of 2026-10-23 are 2.28.0 (TypeScript and Go) and 2.25.0 (Python). As of 2026-10-23 no public security advisory had been published for these three flaws and npm audit and PyPI showed no warnings, so defenders must track versions themselves. V12 also noted a separate payment bypass in @x402/core 2.27.0 (September 2026). V12 recommends that clients check SIWx login messages, set per-payment and total budgets, and limit approved tokens, networks and recipients. Neither V12 nor the x402 Foundation has reported exploitation. Related but separate: GHSA-qr2g-p6q7-w82m (March 2026) covered an earlier Solana facilitator issue fixed in @x402/svm 2.6.0, and a July 2026 study reported 31 vulnerabilities across 15 x402 facilitators; neither should be conflated with the flaws described here.
MITRE ATT&CK techniques by tactic:
Defense Evasion
Initial Access
lateral-movement
T1550 Use Alternate Authentication Material
Resource Development
Impact
Remediation
Patches
- @x402/svm 2.23.0 or later (fixes Solana approval-as-payment)
- @x402/core, @x402/extensions, @x402/fetch, @x402/axios 2.23.0 or later; latest 2.28.0
- x402 Go module 2.28.0; x402 Python package 2.25.0
Immediate actions
- Upgrade all x402 SDK packages to the latest releases: TypeScript @x402/* 2.28.0 or later, Go 2.28.0 or later, Python 2.25.0 or later (minimum fixed releases are dated 2026-08-18; @x402/svm needs 2.23.0 or later)
- Inventory AI agents and services that depend on @x402/core, @x402/svm, @x402/extensions, @x402/fetch, @x402/axios, the x402 PyPI package or the github.com/coinbase/x402/go module, and check lockfiles for pre-fix versions
- Review agent wallet transaction history for unexpected large payments, token Approve instructions or payments to unfamiliar recipients
Workarounds
- Keep the default $1 spendControls cap enabled and do not set spendControls to false
- Require that SIWx challenge domain and URI match the 402 response origin before signing
- Run facilitators on Solana only with the discriminator-checked @x402/svm
Longer-term hardening
- Set per-payment and total budgets on every agent wallet
- Limit approved tokens, networks and recipients with an allowlist
- Use dedicated low-balance wallets for autonomous agents
- Track dependency versions directly because no npm audit or PyPI advisory exists for these flaws
Affected and fixed versions
- x402 Foundation (originally Coinbase) — x402 TypeScript SDK (@x402/core, @x402/svm, @x402/extensions, @x402/fetch, @x402/axios)
Vulnerable versions: 2.0.0-2.22.0 (@x402/svm Solana flaw); all releases before the 2026-08-18 fixes (spend limit and SIWx flaws)
Fixed in: @x402/svm 2.23.0+; @x402/extensions, @x402/fetch, @x402/axios 2.23.0+; @x402/core 2.28.0+; latest 2.28.0 - x402 Foundation (originally Coinbase) — x402 Python package (PyPI x402)
Vulnerable versions: releases before 2026-08-18 (spend limit and SIWx flaws)
Fixed in: 2.25.0+ - x402 Foundation (originally Coinbase) — x402 Go module (github.com/coinbase/x402/go)
Vulnerable versions: releases before 2026-08-18 (spend limit and SIWx flaws)
Fixed in: 2.28.0+
Timeline
- GitHub advisory GHSA-qr2g-p6q7-w82m published for an earlier, separate x402 SDK Solana facilitator issue (fixed in @x402/svm 2.6.0); not part of these three flaws.
- Separate study reports 31 vulnerabilities across 15 x402 payment facilitators (context for the x402 ecosystem's security posture).
- TypeScript PR #3132 merged, adding the TransferChecked discriminator check to the Solana exact scheme in @x402/svm.
- TypeScript PRs #3124 (default $1 spend control) and #3133 (SIWx origin verification) merged.
- x402 Foundation released SDK fixes across TypeScript, Python and Go; @x402/svm 2.23.0 contains the Solana fix.
- V12 Security published findings on three critical x402 SDK flaws, validated with local tests only; no live transactions sent.
- The Hacker News reported the flaws; no CVE, CVSS or public advisory existed, npm audit and PyPI showed no warnings, and latest releases were 2.28.0 (TypeScript, Go) and 2.25.0 (Python).
Sources cited
- GHSA-qr2g-p6q7-w82m - earlier x402 SDK Solana advisory (separate issue, fixed in @x402/svm 2.6.0) GitHub · Advisory · 2026-03-06
- GitLab Advisory Database - npm/@x402/svm GitLab · Advisory
- x402 PR #3124 - default $1 spend control (TypeScript) GitHub · Code repository · 2026-08-13
- x402 PR #3132 - SVM exact TransferChecked discriminator fix (TypeScript) GitHub · Code repository · 2026-08-12
- x402 PR #3133 - SIWx challenge origin verification (TypeScript) GitHub · Code repository · 2026-08-13
- x402 PR #3154 - spend control (Python) GitHub · Code repository
- x402 PR #3156 - spend control (Go) GitHub · Code repository
- x402 PR #3192 - SIWx origin check (Python) GitHub · Code repository
- x402 PR #3193 - SIWx origin check (Go) GitHub · Code repository
- Critical x402 SDK Flaw Could Let Malicious APIs Drain AI Agents' Token Balances The Hacker News · News · 2026-10-23
- 31 newly discovered vulnerabilities expose 99% of x402 crypto payments to asset theft and free shopping (related facilitator study) cryptoslate.com · News · 2026-07-21
- Coinbase and 14 other x402 facilitators failed security tests built for the coming AI-agent economy cryptoslate.com · News
Previous and next in vulnerability
Drafted by the Threadlinqs research pipeline from 12 sources; published ; last updated —.