<?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[Peak Engineering]]></title><description><![CDATA[Peak Engineering]]></description><link>https://peakfo.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6af95c7cb8624a1d8bb4be8c/d223275c-50e9-46be-99e0-5f531b598a39.png</url><title>Peak Engineering</title><link>https://peakfo.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Nov 2026 20:48:02 GMT</lastBuildDate><atom:link href="https://peakfo.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[__cf_chl_tk Explained: The Cloudflare Challenge Token]]></title><description><![CDATA[What the __cf_chl_tk parameter is, why it grants nothing on its own, and how it fits the Cloudflare challenge flow that ends in cf_clearance.]]></description><link>https://peakfo.hashnode.dev/cf-chl-tk-explained</link><guid isPermaLink="true">https://peakfo.hashnode.dev/cf-chl-tk-explained</guid><category><![CDATA[cloudflare]]></category><category><![CDATA[web scraping]]></category><category><![CDATA[debugging]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Peak]]></dc:creator><pubDate>Mon, 16 Nov 2026 07:17:31 GMT</pubDate><content:encoded><![CDATA[<p><em>Cross-posted from the <a href="https://blog.peak.fo/cf-chl-tk-explained/">Peak blog</a>. Disclosure: I work on Peak, a Cloudflare solving API, which comes up near the end.</em></p>
<p>You're watching the network tab while a Cloudflare-protected page loads, and a request goes out to something like <code>/cdn-cgi/challenge-platform/h/g/orchestrate/chl_page/v1?ray=...&amp;__cf_chl_tk=abc123...</code>. The <code>__cf_chl_tk</code> parameter is sitting right there in the query string, and it's not documented anywhere official. So what is it?</p>
<p>Short version: <code>__cf_chl_tk</code> is the Cloudflare challenge token. It's a short-lived handle that ties your browser to a specific in-progress challenge. It is not the thing that lets you through, and that distinction trips up almost everyone who finds it.</p>
<h2>Where it comes from</h2>
<p>When Cloudflare decides a request needs a challenge, it doesn't serve your page. It serves an interstitial, the "Just a moment..." screen, with a challenge script. That script has to talk back to Cloudflare to run the challenge and report the result. The <code>__cf_chl_tk</code> token is how Cloudflare keeps track of <em>which</em> challenge this browser is working on.</p>
<p>Think of it as a claim ticket. When the interstitial loads, Cloudflare issues a token. Every follow-up request the challenge script makes, fetching the orchestration logic, submitting the proof, carries that token so the edge knows these calls all belong to the same session. The <code>ray</code> ID in the same URL is the human-readable log reference; the <code>__cf_chl_tk</code> is the machine-readable session binding.</p>
<h2>What it is not</h2>
<p>It is not your pass. People find <code>__cf_chl_tk</code>, assume it's the magic value that unlocks the site, copy it, replay it, and get nowhere. The token is useless on its own and it dies in seconds. It only has meaning inside the exact challenge flow that minted it.</p>
<p>The thing that grants access is the <a href="https://blog.peak.fo/the-cf_clearance-cookie-explained-and-how-to-reuse-it/"><code>cf_clearance</code> cookie</a>, which Cloudflare sets <em>after</em> you complete the challenge successfully. That's the credential your subsequent requests ride on. The <code>__cf_chl_tk</code> is the plumbing that gets you from "here's a challenge" to "here's your clearance cookie," and then it's done.</p>
<p>So the mental model is a short chain:</p>
<ul>
<li>Request hits a protected page and gets scored as suspicious.</li>
<li>Cloudflare returns the interstitial and issues a <code>__cf_chl_tk</code>.</li>
<li>The challenge script uses that token to run and submit the challenge.</li>
<li>On success, Cloudflare sets <code>cf_clearance</code>.</li>
<li>The token is spent. Your cookie is what matters from here.</li>
</ul>
<h2>How this relates to Turnstile</h2>
<p>This is where people conflate two things that look similar. Turnstile, the widget you embed on your own forms, produces a <code>cf-turnstile-response</code> token that your backend verifies. The <code>__cf_chl_tk</code> you see on the "Just a moment..." screen belongs to Cloudflare's own bot-management challenge (what used to be called the 5-second challenge), which protects a whole site rather than a single form.</p>
<p>Different systems, overlapping vocabulary. If you want the clean separation, we laid it out in <a href="https://blog.peak.fo/the-cf-turnstile-response-token-explained/">the cf-turnstile-response token explainer</a> and <a href="https://blog.peak.fo/the-cloudflare-5-second-challenge-explained/">the 5-second challenge piece</a>. The one-line version: Turnstile is a CAPTCHA you add to a form, the managed challenge is a gate Cloudflare puts in front of the whole site, and <code>__cf_chl_tk</code> is internal to the latter.</p>
<h2>Why it matters if you're automating</h2>
<p>If you're scraping or automating against a site behind Cloudflare's managed challenge, understanding this chain saves you from a dead end. You cannot shortcut it by grabbing the token. You have to run the challenge, in something that looks enough like a real browser to pass the fingerprinting, and come out the other side with a valid <code>cf_clearance</code> cookie. Then you reuse that cookie until it expires.</p>
<p>Running that challenge headless is the hard part, and it's hard on purpose. The challenge script inspects the JavaScript runtime, the TLS handshake, timing, and the usual automation artifacts. Pass those and you get the cookie; fail and you loop back to another <code>__cf_chl_tk</code> and another interstitial.</p>
<p>This is the work a solving API takes off your plate. You hand over the target, something keeps a current browser fingerprint and a clean IP pool, the challenge runs, and you get back the clearance you need. The pattern that holds across the solves we run is simple: the token is never the problem, the fingerprint and the exit IP are. If you'd rather not maintain that yourself, Peak's <a href="https://peak.fo/solve/cloudflare-turnstile/?utm_source=hashnode&amp;utm_medium=syndication&amp;utm_content=cf-chl-tk">Cloudflare solving</a> handles both the Turnstile widget and the managed challenge. <a href="https://peak.fo/docs?utm_source=hashnode&amp;utm_medium=syndication&amp;utm_content=cf-chl-tk">The docs</a> show the request shape.</p>
<h2>In one sentence</h2>
<p><code>__cf_chl_tk</code> is a disposable session token that links your browser to one Cloudflare challenge; it expires in seconds, grants nothing by itself, and the real prize is the <code>cf_clearance</code> cookie you earn by completing the challenge it belongs to.</p>
]]></content:encoded></item><item><title><![CDATA[Cloudflare Turnstile Error Codes: What They Mean and How to Fix Them]]></title><description><![CDATA[What Turnstile error codes 110200, 110100, 400010, 300030 and 600010 mean, where in the flow each fires, and the fix that usually works.]]></description><link>https://peakfo.hashnode.dev/cloudflare-turnstile-error-codes</link><guid isPermaLink="true">https://peakfo.hashnode.dev/cloudflare-turnstile-error-codes</guid><category><![CDATA[cloudflare]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[debugging]]></category><category><![CDATA[web scraping]]></category><dc:creator><![CDATA[Peak]]></dc:creator><pubDate>Sun, 15 Nov 2026 07:33:04 GMT</pubDate><content:encoded><![CDATA[<p><em>Cross-posted from the <a href="https://blog.peak.fo/cloudflare-turnstile-error-codes/">Peak blog</a>. Disclosure: I work on Peak, a Cloudflare Turnstile solving API, which comes up near the end.</em></p>
<p>You wired up Turnstile, the widget renders, and then the console throws <code>300030</code> at you. Or <code>600010</code>. Or a bare <code>[Cloudflare Turnstile] Error: 110200</code> with no explanation. Cloudflare's own docs list the codes but rarely tell you what actually went wrong in your setup.</p>
<p>Here's what each family of codes means in practice, and the fix that usually works. I've grouped them by the part of the flow that failed, because the number itself tells you less than where it fired.</p>
<h2>The quick lookup</h2>
<table>
<thead>
<tr>
<th>Code</th>
<th>What it means</th>
<th>First thing to check</th>
</tr>
</thead>
<tbody><tr>
<td><code>300030</code> / <code>300xxx</code></td>
<td>Generic challenge execution failure</td>
<td>Widget config, sitekey/domain match</td>
</tr>
<tr>
<td><code>110200</code></td>
<td>Domain not allowed for this sitekey</td>
<td>The hostname in your Turnstile dashboard</td>
</tr>
<tr>
<td><code>110100</code> / <code>110110</code></td>
<td>Invalid or unknown sitekey</td>
<td>You're using the wrong key, or a secret key as a sitekey</td>
</tr>
<tr>
<td><code>400010</code></td>
<td>Invalid parameters passed to the widget</td>
<td>Your <code>render()</code> options</td>
</tr>
<tr>
<td><code>600010</code></td>
<td>Challenge solved but the browser looks automated</td>
<td>Your automation fingerprint</td>
</tr>
<tr>
<td><code>600xxx</code></td>
<td>Visitor-side execution / interactivity failure</td>
<td>Network, headless flags, timing</td>
</tr>
</tbody></table>
<h2>110200: domain not allowed</h2>
<p>This one is the most common and the easiest to misdiagnose. Turnstile binds every sitekey to a list of hostnames you set in the Cloudflare dashboard. If the page serving the widget is on a hostname that isn't on that list, you get <code>110200</code> and the widget refuses to run.</p>
<p>Where people trip: testing on <code>localhost</code> when the key is registered for <code>example.com</code>. Or running on <code>staging.example.com</code> when only the apex is allowed. Cloudflare does include <code>localhost</code> automatically for testing keys, but not for production keys.</p>
<p>Fix: open the Turnstile widget settings, check the Hostname Management list, and add whatever hostname your browser's address bar actually shows. Subdomains are not wildcarded unless you add them.</p>
<h2>110100 / 110110: invalid sitekey</h2>
<p>You're passing something that isn't a valid sitekey. The usual culprit is grabbing the <em>secret</em> key (the server-side one, starts with <code>0x4AAAA...</code> too, which makes it easy to confuse) and dropping it into the client widget. The sitekey is public and goes in the browser; the secret key is private and only ever touches your backend for verification.</p>
<p>If you're not sure which key the page is even using, that's its own problem. We wrote a <a href="https://blog.peak.fo/how-to-find-a-cloudflare-turnstile-sitekey/">short guide on finding a Turnstile sitekey</a> on any page.</p>
<h2>400010: bad widget parameters</h2>
<p>Something in your <code>turnstile.render()</code> call is malformed. An action string with disallowed characters, a <code>cData</code> value that's too long, a callback that isn't a function. The widget validates its inputs and bails with <code>400010</code> rather than silently ignoring them.</p>
<p>Read the options back carefully. <code>action</code> must be alphanumeric plus underscores and dashes, 32 characters max. <code>cData</code> has similar limits. If you're generating either dynamically, log the exact string you're passing before <code>render()</code> runs.</p>
<h2>300030 and the 300 family: execution failed</h2>
<p>These are the vague ones. The challenge started, tried to run, and something in its own execution broke. In a real browser this is often transient: a flaky network, an ad blocker or privacy extension nuking the challenge script, or the <code>challenges.cloudflare.com</code> request getting blocked by a corporate proxy.</p>
<p>Reload once. If it clears, it was transient. If it fires every time on the same machine, look at what's sitting between the browser and Cloudflare: extensions, a VPN, a filtering DNS resolver. The challenge needs to load its script and phone home, and anything that interferes shows up as a 300.</p>
<h2>600010: solved, but you look like a bot</h2>
<p>This is the interesting one, and the one that sends people here. The challenge ran, the proof-of-work completed, and Cloudflare still decided the client was automated. You'll see it when you're driving a headless browser, a stealth-patched Chromium, or a plain HTTP client pretending to be a browser.</p>
<p>Turnstile doesn't just check a box. It fingerprints the runtime: the JavaScript engine's quirks, the exact TLS handshake, canvas and WebGL signatures, timing of interactions, and whether the automation flags that Selenium and Puppeteer leave behind are present. When enough of those say "not a human in a normal browser," you get <code>600010</code> even though the math checked out.</p>
<p>The fixes, in order of effort:</p>
<ul>
<li>Strip the obvious automation tells (the <code>navigator.webdriver</code> flag, the CDP artifacts, mismatched user-agent vs TLS).</li>
<li>Use residential or mobile IPs instead of datacenter ranges, which Cloudflare scores harder. We go deep on <a href="https://blog.peak.fo/residential-vs-datacenter-proxies-for-solving/">residential vs datacenter proxies</a> elsewhere.</li>
<li>Match your TLS fingerprint to the user-agent you claim to be. A Chrome UA with a Python TLS signature is an instant flag.</li>
</ul>
<p>At a certain point the maintenance cost of keeping a stealth browser ahead of Cloudflare's fingerprinting is higher than the work itself. That's the trade-off that pushes most people toward a <a href="https://peak.fo/solve/cloudflare-turnstile/?ref=hashnode">solving API</a>: you send the sitekey and page URL, something else keeps the fingerprint current, and you get a valid <code>cf-turnstile-response</code> token back. For what it's worth, across the Turnstile solves we run, the single biggest cause of failures we see isn't the challenge itself, it's customers' own datacenter proxies getting scored down. The <code>600</code> family is almost always an IP or fingerprint story.</p>
<h2>Verifying the token is a separate step</h2>
<p>One more thing worth saying, because it generates its own round of confusion. Getting a token in the browser is only half the job. Your backend still has to POST that token to <code>siteverify</code> with your secret key, and that call returns its own set of error codes in the <code>error-codes</code> array: <code>missing-input-response</code>, <code>invalid-input-response</code>, <code>timeout-or-duplicate</code>.</p>
<p><code>timeout-or-duplicate</code> catches a lot of people. A Turnstile token is single-use and expires after 300 seconds. If you solve it, cache it, and try to verify the same token twice, or verify it five minutes later, Cloudflare rejects it. Solve, verify, move on, all within the window.</p>
<h2>When the error is really "this is too much work"</h2>
<p>If you're hitting Turnstile on a handful of pages for QA or a small scraper, work through the codes above and you'll clear most of them. If you're hitting it at volume and spending your week chasing <code>600010</code> across a rotating fleet, the error codes are a symptom of a bigger problem: keeping a browser fingerprint and an IP pool clean enough to pass is a full-time job, and Cloudflare changes the target regularly.</p>
<p>That's the case Peak exists for. One API call with the sitekey and URL, a token back in about a second, and you pay only for solves that actually work. <a href="https://peak.fo/pricing?ref=hashnode">See what it costs</a>, or read the <a href="https://blog.peak.fo/how-to-solve-cloudflare-turnstile-in-2026-dev-guide/">full developer guide</a> if you want the request and response shape first.</p>
]]></content:encoded></item></channel></rss>