<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Younanix]]></title><description><![CDATA[Younanix]]></description><link>https://younanix.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b02f77dec658a8c4d103787/3d58178b-f463-43d0-84c0-3aac04c984a8.jpg</url><title>Younanix</title><link>https://younanix.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 12:20:26 GMT</lastBuildDate><atom:link href="https://younanix.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[20 of 34 live x402 paywalls hide their payment header from browsers: State of Live x402 Endpoints (November 2026)]]></title><description><![CDATA[Read-only checks across 39 public x402 services: only 7 of 36 live paywalls pass browser CORS, discovery, docs, and clean v2 checks.]]></description><link>https://younanix.hashnode.dev/20-of-34-live-x402-paywalls-hide-their-payment-header-from-browsers-state-of-live-x402-endpoints-november-2026</link><guid isPermaLink="true">https://younanix.hashnode.dev/20-of-34-live-x402-paywalls-hide-their-payment-header-from-browsers-state-of-live-x402-endpoints-november-2026</guid><category><![CDATA[Security]]></category><category><![CDATA[api]]></category><category><![CDATA[Web3]]></category><category><![CDATA[AI]]></category><category><![CDATA[x402]]></category><dc:creator><![CDATA[Younanix]]></dc:creator><pubDate>Mon, 23 Nov 2026 22:52:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b02f77dec658a8c4d103787/6826ec43-d11c-4f82-afaf-5f836a8564d0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A paid route answering HTTP 402 is only the start. A client still has to find the route, read the challenge, and pay the right amount on the right network. So we checked how many live x402 services get the whole path right.</p>
<p>We ran read-only checks against 39 distinct public x402 services. 36 of them (92.3%) returned a live HTTP 402 on a published paid route. Only 7 of those 36 (19.4%) passed every check below.</p>
<h2>Methodology</h2>
<p><strong>Sample.</strong> We took 34 services at random (fixed seed) from the builder-submitted listings of a large public x402 directory. Starting from 1,225 listings, we kept only those marked online and payment-ready and deduplicated them by registrable domain. One pick turned out to be a self-described test server built to misbehave on purpose, so we left it out of every figure. We added 6 services we had already seen promoted in public posts. Each root domain counts once, so a provider with 50 routes is still one service. That gives N = 39.</p>
<p><strong>When.</strong> We sent all paid-route requests on 24 November 2026 between 00:19 and 00:20 (Athens time, UTC+2), and the documentation checks followed a few minutes later.</p>
<p><strong>What we requested, per service:</strong></p>
<ul>
<li><code>GET /.well-known/x402</code></li>
<li><code>GET /llms.txt</code></li>
<li><code>GET /openapi.json</code> (and <code>GET /.well-known/agent.json</code> when no OpenAPI file was served)</li>
<li>Exactly one unpaid request to one published paid route, using the method the service documents. We sent an <code>Origin</code> header so CORS middleware would answer as it would for a browser.</li>
</ul>
<p>There was no authentication, no payment, no fuzzing and no writes, and we requested each path once. Every request had a 10 second timeout and an identifying User-Agent. We re-fetched the documentation files once after fixing a parser bug on our side. We never sent a second request to any paid route.</p>
<p><strong>How we classified results.</strong> A script decoded each <code>PAYMENT-REQUIRED</code> header from base64 JSON and parsed each 402 body.</p>
<ul>
<li><strong>Clean v2:</strong> the header decodes to <code>x402Version: 2</code> with CAIP-2 networks and <code>amount</code>, and the body doesn't contradict it.</li>
<li><strong>Clean v1:</strong> a body-only challenge with <code>x402Version: 1</code>, <code>maxAmountRequired</code> and legacy network names.</li>
<li><strong>Mixed:</strong> anything in between.</li>
</ul>
<p>For 34 live services, a public directory catalog had recorded the route's price, network, asset and payTo. We compared those values field by field with the live challenge, and compared the version of each service's own discovery file with the version it serves live.</p>
<h2>Summary table</h2>
<table>
<thead>
<tr>
<th>Check</th>
<th>Result</th>
<th>Share</th>
</tr>
</thead>
<tbody><tr>
<td>Paid route returned a live HTTP 402</td>
<td>36 of 39</td>
<td>92.3%</td>
</tr>
<tr>
<td><code>/.well-known/x402</code> missing or not JSON</td>
<td>13 of 39</td>
<td>33.3%</td>
</tr>
<tr>
<td>Of those: 404 / HTML page served with 200</td>
<td>10 / 3</td>
<td></td>
</tr>
<tr>
<td>Neither <code>llms.txt</code> nor <code>openapi.json</code> served</td>
<td>5 of 39</td>
<td>12.8%</td>
</tr>
<tr>
<td>Agent paths return the site HTML with a 200</td>
<td>3 of 39</td>
<td>7.7%</td>
</tr>
<tr>
<td>Live 402 sends a <code>PAYMENT-REQUIRED</code> header</td>
<td>34 of 36</td>
<td></td>
</tr>
<tr>
<td>Header not readable cross-origin (CORS)</td>
<td>20 of 34</td>
<td>58.8%</td>
</tr>
<tr>
<td>Of those: no CORS headers at all / allow-origin but no expose list / expose list but no allow-origin</td>
<td>12 / 6 / 2</td>
<td></td>
</tr>
<tr>
<td>402 body has no <code>accepts[]</code> challenge</td>
<td>11 of 36</td>
<td>30.6%</td>
</tr>
<tr>
<td>Header hidden from browsers AND body has no challenge</td>
<td>6 of 34</td>
<td>17.6%</td>
</tr>
<tr>
<td>Live challenge is not clean v2</td>
<td>8 of 36</td>
<td>22.2%</td>
</tr>
<tr>
<td>Catalog or discovery contradicts the live 402</td>
<td>2 of 34</td>
<td>5.9%</td>
</tr>
<tr>
<td>Passed every check</td>
<td>7 of 36</td>
<td>19.4%</td>
</tr>
</tbody></table>
<p>Every number above is computed by script from the saved raw responses.</p>
<h2>The five failure modes we saw most</h2>
<h3>1. The payment header is invisible to browser clients (20 of 34)</h3>
<p>x402 v2 puts the challenge in a <code>PAYMENT-REQUIRED</code> response header. A browser lets cross-origin JavaScript read that header only if the 402 response carries <code>Access-Control-Allow-Origin</code> and also names the header in <code>Access-Control-Expose-Headers</code>. 12 services sent no CORS headers on the 402 at all. 6 sent <code>Access-Control-Allow-Origin: *</code> but no <code>Access-Control-Expose-Headers</code>, so the page sees the 402 status and still can't see the challenge. 2 exposed the header but sent no <code>Access-Control-Allow-Origin</code> on the 402, which blocks the whole response.</p>
<pre><code>HTTP/1.1 402 Payment Required
Access-Control-Allow-Origin: *
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Mi...
(no Access-Control-Expose-Headers)
</code></pre>
<p>A browser wallet or web agent receives a 402 and no way to read the price. A server-side agent sees nothing wrong, which is why this goes unnoticed.</p>
<h3>2. The body says nothing (11 of 36)</h3>
<p>v2 allows the challenge to live only in the header, but 11 services also return a body with no <code>accepts[]</code> array. 6 return <code>{}</code>, 1 returns only <code>{"error":"Payment required"}</code>, and 4 return custom JSON that no x402 client parses. In 6 cases this combines with failure mode 1, so a browser client gets neither a readable header nor a usable body:</p>
<pre><code>HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: eyJ4NDAy...      (not exposed via CORS)

{}
</code></pre>
<h3>3. No discovery, or discovery that lies to the parser (13 of 39)</h3>
<p>10 services return 404 for <code>/.well-known/x402</code>. 3 return their website's HTML with a 200, the single-page-app catch-all. A naive client reads that 200 as a valid catalog and then fails on JSON parsing. Even among the 26 valid discovery files the layout varies: 20 use a top-level <code>resources[]</code> array and 6 use custom layouts (<code>offers</code>, <code>endpoints</code>, <code>items</code>, nested contracts) that a generic indexer has to special-case. In one more case, the route listed first in the discovery file returned 404.</p>
<pre><code>GET /.well-known/x402  -&gt;  200 text/html
&lt;!doctype html&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;Example App&lt;/title&gt;...
</code></pre>
<h3>4. v1 and v2 mixed in one response (8 of 36)</h3>
<ul>
<li>2 services send a v2 header and a v1 body for the same route. The header says <code>"network":"eip155:8453","amount":"10000"</code> and the body says <code>"x402Version":1,"network":"base","maxAmountRequired":"10000"</code>.</li>
<li>3 services put both <code>amount</code> and <code>maxAmountRequired</code> in one v2 object, and one of them does it inside the header.</li>
<li>2 serve a v1 discovery catalog while the live route challenges in v2.</li>
<li>1 is pure v1.</li>
<li>1 puts a v2 challenge in the body but sends no <code>PAYMENT-REQUIRED</code> header.</li>
</ul>
<pre><code class="language-json">{"x402Version": 2,
 "accepts": [{"scheme": "exact", "network": "eip155:8453",
              "amount": "2000", "maxAmountRequired": "2000",
              "asset": "0x0000...0000", "payTo": "0x0000...0000"}]}
</code></pre>
<p>Strict v2 clients may reject these objects, and v1 clients may pick the wrong field. The values happened to agree in every hybrid we saw, so today this is a latent bug rather than an overcharge.</p>
<h3>5. Discovery drifts from the live route (2 of 34)</h3>
<p>In both mismatches, the discovery file advertises <code>x402Version: 1</code> while the live route answers in v2. Prices, networks, assets and payTo addresses matched the catalog everywhere else. We did not count one service whose price is documented as moving with network conditions. Drift was the rarest problem, and it's the one that costs money when it happens.</p>
<h2>Builder checklist</h2>
<ol>
<li>Add <code>PAYMENT-REQUIRED</code> and <code>PAYMENT-RESPONSE</code> to <code>Access-Control-Expose-Headers</code>, and return CORS headers on the 402 response itself, not only on preflight.</li>
<li>Return a body with the same <code>x402Version</code> and <code>accepts[]</code> as the header, or at least a JSON body that points to the header. Don't send <code>{}</code>.</li>
<li>Serve <code>/.well-known/x402</code> as <code>application/json</code> with a top-level <code>resources[]</code> array. Exclude it, <code>/llms.txt</code> and <code>/openapi.json</code> from the single-page-app fallback so they 404 cleanly when absent.</li>
<li>Pick one dialect per response. For v2 that means CAIP-2 networks and <code>amount</code> only, with no <code>maxAmountRequired</code> and no <code>"network":"base"</code>.</li>
<li>Generate discovery, <code>llms.txt</code> and OpenAPI pricing from the same source the 402 middleware reads, and diff them in CI.</li>
<li>Test from a browser origin, not only from curl. Most of these failures only appear in a cross-origin request.</li>
</ol>
<h2>Limits of this sample</h2>
<p>This is one snapshot of 39 services from one directory plus 6 publicly promoted services. It shows what a client meets today, not how the whole ecosystem behaves. We tested one paid route per service, so other routes on the same service may behave differently. We made no payments, so we did not check whether services deliver after settlement.</p>
<h2>Want this run on your own endpoints?</h2>
<p>We did the checks above without paying, signing or logging in. A private audit goes further: every route on your service, payment and settlement edge cases, and a written fix list. Audits are private and by invitation: <a href="https://www.younanix.com/private-audit">https://www.younanix.com/private-audit</a></p>
]]></content:encoded></item><item><title><![CDATA[4 ways x402 paywalls break in production (and how to test yours)]]></title><description><![CDATA[Retries that pay twice, spend caps that fold under parallel calls, catalogs that drift from the live 402, and challenges that don't say what is being paid…]]></description><link>https://younanix.hashnode.dev/4-ways-x402-paywalls-break-in-production-and-how-to-test-yours</link><guid isPermaLink="true">https://younanix.hashnode.dev/4-ways-x402-paywalls-break-in-production-and-how-to-test-yours</guid><category><![CDATA[Web3]]></category><category><![CDATA[Security]]></category><category><![CDATA[webdev]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Younanix]]></dc:creator><pubDate>Sun, 22 Nov 2026 14:12:44 GMT</pubDate><content:encoded><![CDATA[<p>x402 makes charging for an API call look easy: return a 402 with your price, let the client sign a USDC authorization, verify it, serve the response. The happy path works in an afternoon.</p>
<p>The bugs live at the edges: what the client does when the network drops, what happens when ten calls arrive at once, whether your published catalog still matches the live 402, and whether the challenge says exactly what is being paid for.</p>
<p>Over the last weeks we reviewed several x402 sellers, buyer SDKs and agent wallets, some in code and some from the outside with unpaid requests only. These four patterns came up again and again. Names and identifying details are removed, and maintainers hear about findings privately before we write about them.</p>
<h2>1. A retry after a lost response pays twice</h2>
<p>The classic buyer-side failure:</p>
<ol>
<li>The client calls a paid endpoint and gets a 402.</li>
<li>It signs a fresh authorization with a new random nonce and sends the paid request.</li>
<li>The seller settles, but the response is lost to a timeout, a 5xx or a dropped connection.</li>
<li>Normal retry logic starts again, gets a new 402, signs a new nonce and pays again.</li>
</ol>
<p>A similar finding in our audit history: an SDK whose payment call supported idempotency keys, but whose auto-pay handler never passed one. It is also the mistake we planted in our own public sample audit: an agent that retries timeouts up to five times with a new payment each time.</p>
<p><strong>Fix (buyer):</strong></p>
<ul>
<li>Derive an idempotency key per logical request, for example a hash of method, URL, body and the 402 challenge, and send it on every attempt.</li>
<li>On a timeout after signing, check whether the original authorization settled before you sign again.</li>
<li>Return the transaction hash on failure so the caller can resume instead of re-paying.</li>
</ul>
<p><strong>Fix (seller):</strong></p>
<ul>
<li>Honour an <code>Idempotency-Key</code> header: the same key returns the original result, not a fresh 402.</li>
<li>Return 409 if the same key arrives with a different body.</li>
</ul>
<h2>2. Spend caps that break under parallel calls</h2>
<p>Agent wallets advertise daily caps, lifetime caps, balance floors and "never pay the same request twice". In the implementation we tested, all of those were check-then-act: read the ledger, compare, sign, and write the record only after the seller answered. Only finished payments counted.</p>
<p>MCP clients issue parallel tool calls, so this is not an edge case. In a local test through the real MCP server, every call in a parallel burst was paid, well past the daily cap, in every run. Parallel copies of the same idempotency key were each paid once. A per-payment cap has the same weakness from another angle: many small payments pass a limit meant for their total.</p>
<p><strong>Fix:</strong></p>
<ul>
<li>Serialize the critical section from the cap check to the ledger write, in-process and across processes (a lock file works).</li>
<li>Better: write a PENDING reservation before signing, count PENDING toward caps, idempotency and the floor, and resolve it to the final status afterwards.</li>
<li>Treat a PENDING record that never resolves as unknown, not as free. That also closes the crash window.</li>
<li>Add a regression test that fires N calls with <code>Promise.all</code> and asserts the cap holds.</li>
</ul>
<h2>3. The catalog says one thing, the live 402 says another</h2>
<p>Sellers publish their terms in several places: <code>agent.json</code>, an agent card, <code>/.well-known/x402</code>, OpenAPI <code>x-payment-info</code>, <code>llms.txt</code>, a quote endpoint. Buyers and directories trust those files. We compare them with live unpaid 402 challenges, field by field.</p>
<p>The prices usually matched. The drift was elsewhere:</p>
<ul>
<li>A live 402 offered a second payment option, on another chain, to a wallet address that appeared in none of the published catalogs. The seller's own "verify before paying" rules would have rejected it.</li>
<li>An identity document that other agents are told to trust still listed two routes as free. Live, both returned 402 and charged.</li>
</ul>
<p><strong>Fix:</strong></p>
<ul>
<li>Generate every catalog from the same route config that builds the 402.</li>
<li>Add a CI job that fetches each catalog and diffs it against a live unpaid 402 for every paid route: amount in atomic units, asset, network, <code>payTo</code>, timeout, <code>extra</code>.</li>
<li>Retire stale identity files instead of leaving them online.</li>
</ul>
<h2>4. The 402 does not say exactly what is being paid for</h2>
<p>Two related gaps:</p>
<ul>
<li><strong>Weak binding.</strong> On one paid route the challenge named the path only. The query string, which is the actual product on a pay-per-question endpoint, was not in <code>resource.url</code>. We did not test replay, but nothing in the challenge lets a careful wallet bind a payment to the specific question.</li>
<li><strong>Split shape.</strong> One server returned a short JSON body with just a price, while the full terms (<code>accepts</code>, <code>payTo</code>, asset, atomic amount) lived only in the base64 <code>PAYMENT-REQUIRED</code> header. Another returned an x402 v1 body and a v2 header. Clients that read only one place cannot check the destination.</li>
</ul>
<p><strong>Fix:</strong></p>
<ul>
<li>Put the full request URL with a canonical query string in <code>resource.url</code>, or bind a hash of method, path, query and body into the requirements and verify it on settle.</li>
<li>Return the full <code>accepts</code> array consistently, in the shape your docs promise.</li>
<li>Say clearly in your docs that buyers must decode <code>PAYMENT-REQUIRED</code>.</li>
<li>Test your own client against your own server.</li>
</ul>
<h2>The checklist</h2>
<p>Run these before you call an x402 endpoint production ready:</p>
<ul>
<li><input disabled type="checkbox" /> Same <code>Idempotency-Key</code> returns the same result with no second settlement.</li>
<li><input disabled type="checkbox" /> Same key with a different body returns 409.</li>
<li><input disabled type="checkbox" /> A replayed valid payment does not unlock a second request.</li>
<li><input disabled type="checkbox" /> N parallel paid calls never exceed the cap.</li>
<li><input disabled type="checkbox" /> A timeout after signing never leads to a second signature before settlement is checked.</li>
<li><input disabled type="checkbox" /> Every published catalog matches the live 402 for every paid route.</li>
<li><input disabled type="checkbox" /> <code>resource.url</code> names the exact request being paid for.</li>
<li><input disabled type="checkbox" /> Your own client works against your own server.</li>
</ul>
<p>Which of these would your endpoint fail today? Tell us in the comments, we read every one.</p>
<h2>How we test</h2>
<p>We test the live system, not only the code: unpaid requests to compare catalogs with live 402s, replayed payments on systems we are invited to test, and runnable local proofs of concept for code findings. Every finding is checked by a person before it goes out, and each one comes with a way to reproduce it.</p>
<p>If you want a first pass on your own app or payment flow, our <a href="https://www.younanix.com/?utm_source=hashnode&amp;utm_medium=article&amp;utm_campaign=x402-paywalls-writeup#auditor">architecture check is free</a>. If you are building an agent, our MCP endpoint and its docs are here: <a href="https://www.younanix.com/llms.txt">younanix.com/llms.txt</a>.</p>
<p><em>This article was written with the help of AI and reviewed and fact-checked by our team before publishing.</em></p>
]]></content:encoded></item></channel></rss>