How to bypass Cloudflare Turnstile captcha

To bypass a Cloudflare Turnstile captcha, you do not solve anything: the widget shows no image. You obtain a valid token for the site key of the page, place it in the form and let the site’s server confirm it with Cloudflare. This guide explains what bypassing means for a widget without a puzzle, how the token is checked, and the two API calls to make with ilovecaptcha.

Updated on · Written and maintained by the ilovecaptcha team

Preview: the API described here is in public beta. Endpoint names, fields and codes can still change until the end of the beta, and no API key is distributed yet.

What does bypassing Cloudflare Turnstile mean when there is no puzzle?

It means obtaining a token, not answering a question. Cloudflare announced Turnstile on 28 September 2022 as a CAPTCHA alternative that never shows a visual or interactive puzzle: the widget runs checks in the browser and, if they pass, writes a token into the page. A solver has no picture to read. Its job is to return a token that the site’s server will accept.

In that announcement, Cloudflare says its own Managed Challenge had already cut its use of CAPTCHA by 91%. A USENIX Security 2023 study, in which 1,400 participants solved 14,000 CAPTCHAs, found that the time a challenge takes and the annoyance people report do not always match.

What does the widget do while the visitor does nothing?

According to Cloudflare’s documentation, Turnstile runs a series of small non-interactive JavaScript challenges and adapts the outcome to the individual visitor or browser. It names three kinds:

  • Proof-of-work, described as computational puzzles handed to the browser.
  • Proof-of-space, listed alongside it.
  • Probing for web APIs, completed by other challenges that look for browser quirks and human behaviour.

Cloudflare’s 2023 general availability post puts it plainly: checking the box is not what matters, the background data analysed while it is checked is.

Which Turnstile modes exist, and what does the visitor see?

Three, chosen by the site owner: managed, non-interactive and invisible. None of them shows an image. The mode only decides whether a frame appears in the page and whether the visitor may get a box to tick. For a script, only what is visible changes: all three modes produce the same kind of token.

The three Turnstile widget modes, according to Cloudflare’s documentation
Mode What is displayed Interaction
Managed A widget that shows a checkbox only if a further check is needed Sometimes: tick a box
Non-interactive A widget with a loading spinner Never
Invisible Nothing: no widget, no sign that a check is running Never

How does the widget sit in a page?

The page loads Cloudflare’s api.js script from challenges.cloudflare.com. The script looks for elements carrying the cf-turnstile class and reads their data-sitekey attribute; a site can also call turnstile.render itself with a sitekey. In its normal size the widget is a 300×65 pixel frame, and 150×140 in its compact size. Once the checks pass, an invisible input named cf-turnstile-response is added to the form and travels to the server with the other fields.

How does the site’s server check a Turnstile token?

With one server-to-server call. The site’s back end posts the token and its secret key to Cloudflare’s siteverify endpoint and reads a JSON answer whose success field says whether to trust the form. According to Cloudflare, this validation is mandatory, a token is valid for 300 seconds from generation, it is meant for a single validation and it can be up to 2,048 characters long. The answer also reports the hostname where the challenge was served, and the action and cdata values set by the page.

Why is a token refused although the widget passed?

  • It is older than 300 seconds: siteverify answers timeout-or-duplicate.
  • It was already validated once: same timeout-or-duplicate code, since the first check spends the token.
  • It was truncated or altered on the way: invalid-input-response.
  • The site compares hostname, action or cdata with what its own page set, and the token was issued for something else.

The first two are timing problems, fixed by requesting a new token just before the form is sent.

Is the “Just a moment…” page the same thing as Turnstile?

No. That full-page screen is what Cloudflare calls an interstitial Challenge Page: it appears before the visitor reaches the destination URL, on sites that Cloudflare protects, and it holds the request while the browser is checked. Turnstile is the embeddable widget, usable on any site without sending its traffic through Cloudflare. The checks are related, the result is not: the widget ends with a form token, the Challenge Page with a cf_clearance cookie.

How do you tell which one you are facing?

Embedded Turnstile widget and Cloudflare Challenge Page compared
Point Turnstile widget Challenge Page
Where it shows Inside the site’s own page, next to a form Instead of the page, before it loads
How to recognise it A cf-turnstile element carrying a data-sitekey A response whose cf-mitigated header is set to challenge
What success produces A token in cf-turnstile-response A cf_clearance cookie

The cloudflare-turnstile task type returns a token for the embedded widget. It does not produce a clearance cookie, so this guide stops at the widget.

What do you send for a Turnstile task, and what comes back?

You send the task type cloudflare-turnstile with two strings: websiteURL, the address of the page that displays the widget, and websiteKey, the public site key found in that page. There is no image and no instruction. The API answers with solution.token, the value the form expects in cf-turnstile-response.

The Cloudflare Turnstile task at a glance
Item Value
Publisher Cloudflare
Challenge family Non-interactive widget
Task type cloudflare-turnstile
You send Site key + page URL
You get back Token to inject
Vendor documentation Cloudflare documentation

How do you bypass Cloudflare Turnstile captcha with the ilovecaptcha API?

In five steps and without a screenshot: the site key and the page address go in, a token comes out, and the form carries it to the server.

  1. Read the site key. Find data-sitekey on the cf-turnstile element, or the sitekey passed to turnstile.render.
  2. Create the task. POST createTask with the type cloudflare-turnstile, websiteURL and websiteKey.
  3. Poll the task. Repeat getTaskResult every 1 to 2 seconds while status reads processing.
  4. Place the token. Once status is ready, write solution.token into the hidden cf-turnstile-response field.
  5. Submit in time. Send the form within 300 seconds: the token can be validated only once.

The site’s server then calls siteverify. A refused token is replaced by a new task.

What does a Turnstile request look like?

The request below creates a cloudflare-turnstile task for a sign-up page. websiteKey holds the public site key copied from the page; the value shown here is a made-up example, not a key in service. The response carries a single string, solution.token, cut short here: a real token can reach 2,048 characters, so never store it in a short field.

POST /createTask
Content-Type: application/json

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "cloudflare-turnstile",
    "websiteURL": "https://example.com/login",
    "websiteKey": "0x4AAAAAAAEXAMPLE_SITE_KEY"
  }
}

→ 200 { "errorId": 0, "taskId": "tsk_8f3a1c2e", "status": "processing" }

POST /getTaskResult
Content-Type: application/json

{ "clientKey": "YOUR_API_KEY", "taskId": "tsk_8f3a1c2e" }

→ 200 { "errorId": 0, "status": "ready", "solution": { "token": "0.zrSnRHO7h0HwSjSCU8oyzbjEtD8p…" } }
A createTask request for a Cloudflare Turnstile task, then the getTaskResult answer once the task is ready (preview format).

Turnstile bypass: frequently asked questions

Is there anything to solve in a Cloudflare Turnstile captcha?

Not for the visitor, and not for a solver in the usual sense. Turnstile shows no image, no text and no slider; in managed mode the most it asks for is a tick in a box. What the site receives in the end is a token. Bypassing Turnstile therefore means getting a token that passes the site’s server-side check; that is what the cloudflare-turnstile task of the ilovecaptcha API returns.

Why does my script tick the Turnstile checkbox and still get no token?

Because the click is not the test. Cloudflare wrote in September 2023 that the act of checking the box is not important, and that the background data analysed in the meantime is what matters. A click produced by a script therefore decides nothing: the widget assesses the browser that runs it. When the checks do not pass, no token is written into the form, whatever was clicked.

How long does a Turnstile token stay valid, and can it be reused?

A token is valid for 300 seconds, five minutes, after it is generated, and it is meant for one validation only. Cloudflare’s siteverify endpoint answers timeout-or-duplicate for a token that has expired or has already been validated. Request the token as late as possible, send the form straight away and never keep tokens in reserve. If the form is rejected, create a new task instead of sending the same token again.

Does the ilovecaptcha browser extension pass Turnstile?

It handles the Turnstile checkbox in Chrome and Firefox, with one difference between the two. In Chrome 116 or newer, it clicks the box with a trusted click sent through the Chrome debugger API, without calling the solver. Firefox 140 or newer has no equivalent API: the box gets a synthetic click, which Cloudflare may rate lower than a trusted one. The extension is not published on the browser stores: it is installed from a folder, as a developer extension, and the build available today talks to a local gateway.

Which uses of a Turnstile solver are legitimate?

Look first at who owns the widget. On your own site, Cloudflare provides test keys: the site key 1x00000000000000000000AA always passes and yields a dummy token, with no solver involved. A solver is for authorised work where the production widget stands in the way: monitoring a flow you operate, accessibility automation, academic research, or collecting public data within the target site’s terms and the applicable law. OWASP files the abusive side under OAT-009, CAPTCHA Defeat. Credential stuffing, spam and payment fraud are not supported by ilovecaptcha.

Sources

The facts and figures quoted on this page come from these sources.