Errors & CAPTCHAs

AWS WAF CAPTCHA and Challenge: Amazon's bot check stopped you

CAPTCHAs · AWS WAF CAPTCHA
Published · Updated
Made by
AWS
Variants
CAPTCHA action (status 405, puzzle) · Challenge action (status 202, silent script) · CAPTCHA JavaScript API widget

What you see

  • x-amzn-waf-action: captcha
  • x-amzn-waf-action: challenge
  • aws-waf-token
  • 405 Method Not Allowed
More error strings (5)
  • window.gokuProps
  • challenge.js
  • token.awswaf.com
  • AwsWafIntegration
  • Let's confirm you are human

What it means

Amazon’s firewall (AWS WAF) stopped your request before it reached the site. It wants proof that a real browser, or a real person, is asking. You get status 405 for a puzzle (CAPTCHA) or 202 for a silent browser check (Challenge), not the page you wanted.

What we measured: free tools on AWS WAF sites

We ran 11 free scraping tools on the AWS WAF sites in our test (all sites), each as installed with one setting for every site, with a fresh IP for every load (open-source benchmark, run scrapenews-open-source-benchmark-2026-11-26, 26 Nov 2026). Share of loads that passed:

ToolAWS WAF
Camoufox58% (7/12)
Scrapling StealthyFetcher75% (9/12)
Botasaurus25% (3/12)
nodriver33% (4/12)
Patchright75% (9/12)
curl-impersonate0% (0/12)
curl_cffi0% (0/12)
Scrapling Fetcher0% (0/12)
Crawl4AI0% (0/12)
tls-client0% (0/12)
curl (plain)0% (0/12)
  • Top tools: Scrapling StealthyFetcher, Patchright and Camoufox tie (58–75%).
  • Top HTTP clients: none passed.

Which tool types get past it: start from the table. Scraper and unblocker APIs run this step for you; we have not measured them on AWS WAF.

Why it happens

The site owner wrote a firewall rule with a CAPTCHA or Challenge action. When your request matches it, AWS checks one thing: do you carry a valid aws-waf-token cookie?

  • Valid token: you go through.
  • No token, a bad one or an old one: you’re blocked and get the check instead.

Why you have no valid token, most common first:

  1. Your client can’t run JavaScript. An AWS script in the browser makes the token. requests, curl and plain fetch never run it.
  2. You’re going too fast. AWS tells site owners to add a rate rule that shows CAPTCHA or Challenge at a lower limit than their hard block.
  3. Your token expired. Each pass lasts an “immunity time” the site sets. The default is 300 seconds (5 minutes).
  4. Your token doesn’t match. It’s tied to the site’s domain. AWS Bot Control also compares the type of IP that got the token with the type of IP sending it. The FuckCaptcha project says a new IP or user agent mid-session usually breaks it.
  5. The AWS script is blocked. It loads from awswaf.com. In one report, a NoScript user saw a blank IMDb page until they allowed that domain.

Accessibility: AWS says its puzzles offer an audio version, screen reader and keyboard support, and meet WCAG (the web accessibility standard). A11Y Boost notes that audio CAPTCHAs are often distorted and still hard for people with hearing loss or cognitive impairments.

Why two actions? AWS pitches CAPTCHA as the middle road: for traffic where a hard block would stop too many real people, but letting everyone in lets in too many bots. Challenge is the quiet version. It checks in the background that the client is a browser, and a human visitor never sees a thing.

“Run JavaScript” is only half of it. The challenge script questions the browser and writes the answers into the token: signs of automation, and browser settings that don’t add up. So a headless browser that looks automated carries that inside its pass.

Throwing tokens away doesn’t make you new, either. With AWS’s bot and fraud rule groups, AWS computes a browser fingerprint ID that stays the same across new tokens. Bot Control’s targeted rules also cap how many requests a client may send without a valid token.

Fix it

  1. Confirm it’s AWS WAF. Look for the header x-amzn-waf-action with captcha or challenge. A 405 without it is a normal “wrong method” error from the site.
  2. Slow down. Fewer requests per minute keeps you under the rate rule that often shows the check.
  3. Look for an unchecked door. An official API, open data portal or feed on another path may not sit behind the rule.
  4. Challenge (202)? Use a real browser. Let challenge.js run. It saves the token and resends your request on its own. FuckCaptcha names Patchright, Camoufox and undetected-chromedriver for this.
  5. Keep the token, IP and user agent together. Send aws-waf-token on every request to the same host. Expect a new check when the immunity time runs out (sites can set 1 minute to 3 days). FuckCaptcha says curl_cffi can reuse the token if its browser fingerprint matches.
  6. CAPTCHA (405)? You need a person or a solving service. Services whose docs list AWS WAF: 2Captcha, Anti-Captcha, CapMonster Cloud, CapSolver. They ask for key, iv and context from window.gokuProps on the check page. Grab fresh values every time.
  7. Your own site? Put these actions only on GET requests that want HTML. AWS says they can’t run on POST, preflight OPTIONS or other methods. For APIs, check an HTML page first and set the immunity time long enough to cover the API calls that follow.

Why slow down first? Every new token costs you a browser run or a paid solve. Staying under the rate rule costs nothing.

Why keep IP and user agent fixed? AWS says the token fingerprints the client session with client identifiers. Bot Control also labels requests where the IP that got the token and the IP using it are of different types. The site’s rules then decide what to do with that label. So solving on one machine and spreading the token over a proxy pool is asking for trouble.

Why fresh values for solvers? CapMonster Cloud says some values change with every render of the page. Anti-Captcha calls iv and context temporary and key permanent.

Our advice: keep one browser session alive per site. FuckCaptcha notes the token refresh logic lives in the AWS script, so a live session renews its pass on its own.

Paste this into your AI

My scraper hits an AWS WAF check instead of the real page.
Status: <405 or 202>. Header x-amzn-waf-action: <captcha / challenge / missing>.
Body: <empty, or a page with window.gokuProps and challenge.js>.
Explain in plain words what this check is.
Then list the likely causes in order, most likely first.
For each cause, give one way to test it and one fix.
My setup: <language + library>, <the URL pattern>, <requests per minute>,
<proxy type or none>, <the request headers I send, incl. Accept>,
<do I keep the aws-waf-token cookie between requests: yes/no>.

Dev details

What AWS sends back (from the AWS docs):

# CAPTCHA
status: 405
x-amzn-waf-action: captcha

# Challenge
status: 202
x-amzn-waf-action: challenge

# both
access-control-allow-origin: *
access-control-allow-methods: OPTIONS,GET,POST
access-control-max-age: 86400
access-control-expose-headers: x-amzn-waf-action
  • The check page comes only if your request has Accept: text/html. Without it, expect an empty body.
  • The exposed CORS header means browser JavaScript can read x-amzn-waf-action, even cross-origin.
  • Page markers: window.gokuProps = {"key": …, "iv": …, "context": …}, window.awsWafCookieDomainList, <div id="challenge-container"> and a script like https://<id>.<region>.token.awswaf.com/…/challenge.js. The puzzle script comes from …captcha.awswaf.com/…/captcha.js.

Detect it before you parse:

const res = await fetch(url, { headers });
const action = res.headers.get("x-amzn-waf-action"); // "captcha" | "challenge" | null
if (action) throw new Error(`AWS WAF ${action} on ${url} (status ${res.status})`);

Edge cases:

  • 202 looks like success. It’s a 2xx code. One search crawler stored 191,605 AWS WAF 202 pages as “fetched” in 24 hours, 20.5% of its pages (measured 2026-11-08). A feed reader logged fetched 0 items with no warning (2026-10-05). Check the header, not just the status.
  • CAPTCHA runs the challenge first. With no token yet, the CAPTCHA page runs the silent challenge, then the puzzle. On success it resends your original request.
  • Puzzles rotate. AWS shows picture grids (“Choose all the chairs”) and an audio version, and keeps adding new types. FuckCaptcha also lists a distorted-text version.
  • HTTPS only. Puzzles and challenges run only on HTTPS pages, in a secure browser context.
  • Domain match. By default the token works only for the exact Host. A site’s token domain list (e.g. example.com) also covers its subdomains.
  • Immunity limits. Default 300 seconds for both. Minimum 300 for Challenge, 60 for CAPTCHA, maximum 259,200 (3 days). A rule can override the site-wide value.
  • What’s in the token. It’s encrypted. It holds the last challenge and CAPTCHA solve times plus browser checks, such as signs of automation and settings that don’t add up.

Why is the body so often empty? The check page only comes for Accept: text/html. An API client that asks for JSON gets a bare 202 or 405. Your code then sees a JSON parse error, or “0 items”, and never the word CAPTCHA.

In a pipeline, make the check a named outcome, not a crash or a success. Read x-amzn-waf-action on every response, log the URL and count checks per domain. A sudden jump means the site changed its rules or flagged your setup. Never store a checked page as real content.

If you run the site and real users loop: with AWS’s bot or fraud rule groups on, each request gets token labels. awswaf:managed:token:accepted means fine. rejected:expired, rejected:domain_mismatch, rejected:not_solved and absent tell you why a check fired. The awswaf:managed:captcha: versions do the same for the puzzle.

Open questions

AWS doesn’t say everything its token checks. For security reasons, it gives no full list of what goes inside or how it’s encrypted.

Why it matters: the exact rules for reusing a token are not public. AWS documents the domain match, the immunity time and Bot Control’s IP-type check. Beyond that, advice like “a new IP or user agent usually breaks the token” comes from people who solve these checks, not from AWS.

So test it on the site you care about. Reuse one token, change one thing at a time (IP, user agent, headers) and watch when x-amzn-waf-action comes back.

scrapenews difficulty

24/100 · Easy from 4 of 8 factors

FactorWhat we foundSource
Smallest client that gets throughan HTTP client that runs the page's JavaScriptscrapfly.io
Checks stackedIP reputation, JavaScript challengescrapfly.io
Cheapest solver price$1.40 per 1,000 solvescapmonster.cloud
Steps for a humannone: nothing to clickdocs.aws.amazon.com

Our analysis of 4 sourced facts; measured runs replace them as they come. How we rate difficulty

Tools that get past it

ToolPrice
2Captcha: CAPTCHA solving API (reCAPTCHA, Turnstile, image and more), priced per 1,000 solves by CAPTCHA type.$1.00/1k solves
Anti-Captcha: CAPTCHA solving API, pay as you go per 1,000 CAPTCHAs, price set by CAPTCHA type.$0.95/1k solves
Camoufox: Anti-detect browser built on Firefox that changes fingerprints to look like a real user; works with Playwright.Free
CapMonster Cloud: CAPTCHA solving service priced per 1,000 tokens or images, covering reCAPTCHA, Turnstile, AWS WAF and more.$0.60/1k solves
CapSolver: AI-based CAPTCHA solving API for reCAPTCHA, image CAPTCHAs and others, priced per 1,000 solves.from $6.00
curl_cffi: Python HTTP client on curl-impersonate that can copy a browser's TLS, JA3 and HTTP/2 fingerprints.Free
Patchright: Drop-in patched version of Playwright that hides common automation signs.Free
undetected-chromedriver: Patched Selenium ChromeDriver made to avoid bot detection. nodriver, by the same author, is its successor.Free

Sources

  1. AWS docs: CAPTCHA and Challenge action behavior (405, 202, x-amzn-waf-action) docs.aws.amazon.com
  2. AWS docs: CAPTCHA and Challenge in AWS WAF (when each is used) docs.aws.amazon.com
  3. AWS docs: Types of token labels (accepted, rejected, absent, fingerprint) docs.aws.amazon.com
  4. AWS docs: Token immunity times docs.aws.amazon.com
  5. AWS docs: AWS WAF token characteristics (aws-waf-token) docs.aws.amazon.com
  6. AWS docs: How AWS WAF uses tokens (Bot Control IP check) docs.aws.amazon.com
  7. AWS docs: Token domains and domain lists docs.aws.amazon.com
  8. AWS docs: Best practices for CAPTCHA and Challenge docs.aws.amazon.com
  9. AWS docs: AWS WAF CAPTCHA puzzles (audio, screen readers, WCAG) docs.aws.amazon.com
  10. AWS docs: CAPTCHA puzzle examples docs.aws.amazon.com
  11. FuckCaptcha (CC0): Amazon WAF CAPTCHA field guide (signals) github.com
  12. A11Y Boost: Are CAPTCHA systems failing accessibility? a11yboost.com
  13. 2Captcha docs: Amazon WAF captcha 2captcha.com
  14. Anti-Captcha docs: Bypass Amazon WAF (gokuProps and widget) anti-captcha.com
  15. CapMonster Cloud docs: Amazon AWS WAF Captcha and Challenge docs.capmonster.cloud
  16. CapSolver docs: AWS WAF CAPTCHA token (405 + gokuProps) docs.capsolver.com
  17. bxl_eda_worker issue #15: European Parliament feeds get 202 + x-amzn-waf-action: challenge github.com
  18. WebSearchEngine issue #34: AWS WAF 202 pages stored as fetched github.com
  19. NoScript issue #507: AWS challenge shows a blank page on imdb.com github.com