x402's asset gap: the facilitator pays in any contract with bytecode
Before an x402 facilitator's wallet pays gas to call a token contract, it checks one thing about that token: that the address holds bytecode. Not that it is a token the facilitator lists. Not that it is a token anyone reviewed.
An x402 payment names an asset. The client signs an authorization over it, the resource server quotes a price in it, and the facilitator's own wallet submits the transaction that moves it. Three parties touch the asset field, and only one of them can be trusted to check it — the resource server, matching the client's choice against its own menu. The facilitator, the party whose private key signs the settlement, checks only that the address is a contract.
That gap is the subject of two open issues from the same researcher, #4161 (the resource-server side) and #4195 (the facilitator side), both filed in the week before this post. We read the shipped code at @x402/evm and @x402/core 2.30.0, built a facilitator from it, and drove it — plus two live facilitators — into paying in contracts nobody listed.
What the facilitator actually checks
In the EIP-3009 verify path of the published @x402/evm 2.30.0, the asset is validated by exactly one function. It reads the address's code and returns an error only when there is none:
async function validateAssetIsContract(signer, network, asset) {
// cache hit for a known-good (network, asset) short-circuits
const code = await signer.getCode({ address: getAddress(asset) });
if (!code || code === "0x") {
return ErrAssetNotDeployedContract;
}
return ""; // any contract passes
}
Everything else in verify is about the authorization, not the asset: the EIP-712 domain is built from requirements.extra.name and requirements.extra.version, the signature is recovered against the payer, the to must equal payTo, the value must equal the amount, and the window must be live. The token itself only has to exist. A read-only transferWithAuthorization simulation runs at the end, which catches a contract that reverts — but a contract that returns success is waved through, and settle re-simulates only when a facilitator explicitly turns it on. This is the same shape we traced when the EVM verify rules were written down as MUST clauses: the token is assumed, never constrained.
Driving the shipped facilitator
We registered ExactEvmScheme from @x402/evm 2.30.0 on an x402Facilitator, pointed its signer at a local chain, and had a real client sign v2 payloads. We counted every RPC call the facilitator's signer aimed at the asset, and every wei of gas its wallet spent. Four assets, one offer: the server only ever advertised a single listed token.
// stock @x402/evm 2.30.0 facilitator, all four priced identically
listed token verify=valid settle=success gas 87,327 payTo +10000 (good)
client-deployed verify=valid settle=success gas 87,327 payTo +10000 (worthless)
gas-sink contract verify=valid settle=success gas 4,531,413 payTo +0
price-trap contract verify=valid settle=FAILED (transaction_failed)
The second row is the attack in #4161 and #4195. We deployed a plain EIP-3009 token with an open mint, named it in accepted.asset, and signed over it. The facilitator verified and settled; 10,000 units of a token we minted for free landed at payTo, and the facilitator paid the gas. The SDK resource server would have refused this payload — its matcher returned "no match" — but the facilitator settles the requirements it is handed, and does not re-derive them.
The third row is worse than a worthless payment. We deployed a contract that is not a token: its transferWithAuthorization checks nothing, writes 200 storage slots, then emits the Transfer event the facilitator looks for. The facilitator verified it, settled it, and its own wallet spent 4,531,413 gas — roughly 0.0061 ETH on our fork — to move zero tokens. Any address that can get a facilitator to settle can make that facilitator's wallet burn gas on demand. On a hosted facilitator that is someone else's money.
We then re-ran the same four payments through a facilitator with an onBeforeVerify / onBeforeSettle hook that checks requirements.asset against a one-entry allowlist. The listed token still worked. Every other asset was rejected with asset_not_allowed, before any call to the contract: zero getCode, zero simulation, zero gas. The fix is small and it is entirely outside the scheme.
The resource server is the only real gate — and the spec never requires it
Why does this not happen constantly today? Because every official SDK resource server matches the client's accepted against its own accepts[] before it calls the facilitator. In @x402/core 2.30.0 it is findMatchingRequirements, which runs paymentRequirementsMatchAccepted — an exact comparison of scheme, network, amount, asset, payTo and timeout, plus a subset check on extra. The Python and Go servers do the same (find_matching_requirements, FindMatchingRequirements). We read all three; they agree.
But that obligation lives only in the SDKs. The v2 specification at commit 4f67451 defines accepted in §5.2.2 as "PaymentRequirements object indicating the payment method chosen," describes the verify steps against "the PaymentRequirements," and in §10 covers replay and authentication — and never says which requirements the server must send, nor that it must bind the client's accepted to its own menu. A resource server written from the specification, rather than copied from an SDK, can answer every other part of the protocol correctly and still forward the client's terms verbatim. Then the client sets the price, the recipient, and the token, and the facilitator — which only checks bytecode — has nothing to catch it with. The issue author measured exactly this on Base Sepolia: with the SDK matcher swapped for one that returns the client's accepted, a payment in a client-deployed token settled on chain, and 10,000 units went to an address the server never offered.
Two live facilitators, read-only
To check this against running infrastructure without moving any funds, we sent a single /verify call — never /settle — from a fresh, zero-balance payer to public facilitators on 2026-11-12. The control was native USDC; the probe was WETH, the canonical Base predeploy at 0x4200…0006, which is a real contract but has no transferWithAuthorization and is not on any x402 asset list.
// /verify only, zero-balance payer, 2026-11-12
facilitator.payai.network (base) USDC → insufficient_balance WETH → isValid: true
www.x402.org/facilitator (sepolia) USDC → insufficient_balance WETH → isValid: true
The USDC control reached the token and reverted on balance, as it should for a payer with nothing. WETH came back isValid: true. WETH's fallback accepts the unknown four-argument call and returns without reverting, so the facilitator's read-only simulation sees a success and reports the payment valid. On a Base mainnet fork we took that one step further: a facilitator asked to settle in WETH broadcast a real transaction, its wallet paid 28,300 gas, the transaction succeeded on chain — and no USDC moved. Only the facilitator's own post-settlement log check (verifyEip3009TransferEvent) noticed afterward that no matching Transfer had happened, returning transfer_event_mismatch after the gas was already spent. Other public facilitators we probed stopped earlier, but for unrelated reasons: one on a pricing-policy floor, one on an API key, one on payee registration. None of them gated on the asset.
Where the fix has to go, and why it has not landed
The precedent already exists in the SDK. For counterfactual smart-wallet deploys, the facilitator refuses to call a factory unless its address is on eip6492AllowedFactories, which defaults to an empty list that denies everything. An asset is the same shape: a contract the facilitator's wallet calls because a request named it. The proposal in #4195 is a sibling field, allowed_assets / allowedAssets keyed by network, checked before any RPC call to the token.
There is one subtlety the issue thread surfaced and we confirmed in the code: a check placed inside the EIP-3009 verify would miss Permit2 payments entirely, because verify and settle dispatch Permit2 to its own path before the EIP-3009 one in all three SDKs. The check has to sit at the top of the scheme — or in the facilitator hooks, which run before scheme dispatch, which is why the hook-based allowlist we tested covers both paths. That matters on Base mainnet, where the SDK's DEFAULT_ASSETS table lists only native USDC, yet in the CDP Bazaar catalog on 2026-11-12 we counted 818 advertised Base routes naming a non-USDC token across 32 hosts, 381 of them settling over Permit2 — exactly the payloads an EIP-3009-only check would never see.
Two pull requests try to write the rules down. #4230 adds a "Requirement Binding" section to the v2 spec, obliging the resource server to match accepted against its published accepts[] before calling the facilitator. #4231 inserts a "Facilitator Asset Allowlist" step into the EVM exact verify list. Both are open, both are documentation-only, and both are blocked on the same housekeeping: unverified commits and CI awaiting maintainer approval. Neither rule is in @x402/evm 2.30.0, the version live on npm as of this writing. The asset field is still guarded by a single getCode.
What it means for LLM4Agents
Our gateway is a resource server and, in the x402 path, it also decides what it hands a facilitator. The protective matcher we rely on is the SDK's — which means our safety here depends on never bypassing it. Anywhere we build a 402 response or a verify/settle call by hand, for a custom price or a streaming walk-up, we own the binding that #4161 says the spec should mandate: the asset, payTo, amount and EIP-712 domain we send to the facilitator must be ours, derived from our price table, never copied from the inbound payload. A client that rewrites accepted must not be able to redirect our settlement into a token we never quoted.
If we ever run or self-host a facilitator — signing settlements with our own key — the asset allowlist stops being optional. A facilitator that checks only bytecode will pay gas to call whatever a request names, which means a worthless-token payment that credits an agent for nothing, and a gas-griefing contract that drains the signing wallet. The same discipline we already apply to the DEFAULT_ASSETS table — treat it as an allowlist and a ceiling, not a convenience — has to extend to any token our own wallet is about to call.
Staying on the frontier
Concrete steps, in order. First, audit every place our gateway constructs x402 requirements by hand and assert that the asset, recipient and amount come from our catalog, not from the request — the same lesson as the client-side price-expectation gap, now on the server side. Second, pin an explicit asset allowlist for every network we settle on, Permit2 included, so a token outside it is refused before any contract call, exactly as the hook we tested does. Third, if we depend on a hosted facilitator, treat its asset policy as a question we must answer, not assume: a /supported entry proves nothing about what it will settle, so we probe it read-only, as we did here. Fourth, track #4230 and #4231 to merge and adopt the asset-allowlist field the moment it ships in @x402/evm, rather than carrying our hook indefinitely. The cheapest guard in this whole stack is the one the facilitator skips: refuse the token before you call it.
One key. All tools. The agent pays.
LLM4Agents is an OpenAI-compatible gateway where autonomous agents pay per call in stablecoins over x402 — with the asset, the price and the recipient fixed on our side, not the caller's.
Register an agent