<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: LudaxProxy</title>
    <description>The latest articles on DEV Community by LudaxProxy (@ludaxproxy).</description>
    <link>https://dev.to/ludaxproxy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252105%2F812988dc-67d6-44c2-a5ec-1364160dc8bf.jpg</url>
      <title>DEV Community: LudaxProxy</title>
      <link>https://dev.to/ludaxproxy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ludaxproxy"/>
    <language>en</language>
    <item>
      <title>Why your scraper gets a 403 from Cloudflare (and the fix that got us a 200)</title>
      <dc:creator>LudaxProxy</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:02:16 +0000</pubDate>
      <link>https://dev.to/ludaxproxy/why-your-scraper-gets-a-403-from-cloudflare-and-the-fix-that-got-us-a-200-4491</link>
      <guid>https://dev.to/ludaxproxy/why-your-scraper-gets-a-403-from-cloudflare-and-the-fix-that-got-us-a-200-4491</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: we're the team behind a residential proxy service, and the passing request in this test goes through our own gateway. The diagnosis and the checklist apply whatever tools you use.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If your scraper sends perfect Chrome headers from a clean IP and still gets a 403 with a "Just a moment..." page, the decision was usually made before your headers were even read. This post takes a real Cloudflare challenge response apart, shows which signals triggered it, and walks through the change that turned it into a 200, without a headless browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why your scraper gets 403 before it renders anything
&lt;/h2&gt;

&lt;p&gt;Cloudflare scores every request on a handful of transport-level signals long before your crawling logic runs. Most HTTP clients fail several of them at once:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;Real Chrome sends&lt;/th&gt;
&lt;th&gt;A plain HTTP client sends&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TLS ClientHello&lt;/td&gt;
&lt;td&gt;Chrome's own handshake&lt;/td&gt;
&lt;td&gt;The TLS library's handshake, matching no browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP protocol&lt;/td&gt;
&lt;td&gt;HTTP/2 or HTTP/3&lt;/td&gt;
&lt;td&gt;HTTP/1.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Header order and set&lt;/td&gt;
&lt;td&gt;Client hints (&lt;code&gt;sec-ch-ua&lt;/code&gt; and friends) in Chrome's order&lt;/td&gt;
&lt;td&gt;A minimal library set in library order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IP reputation&lt;/td&gt;
&lt;td&gt;A home or mobile address&lt;/td&gt;
&lt;td&gt;A datacenter or already-flagged host&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's why a crawler can be blocked on its very first request: no rate limiting, no odd click pattern, just a handshake that doesn't look like any browser.&lt;/p&gt;

&lt;p&gt;We tested this on 26 October 2026 against &lt;code&gt;leetcode.com&lt;/code&gt;, a Cloudflare-protected site, from a host in Frankfurt. A direct request from a plain HTTP/1.1 client (the kind of connection &lt;code&gt;python-requests&lt;/code&gt; or default &lt;code&gt;curl&lt;/code&gt; makes) came back like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Address: https://leetcode.com/
Response code: 403
Negotiated protocol: HTTP/1.1

Cf-Mitigated: challenge
Server: cloudflare
Content-Type: text/html; charset=UTF-8
Content-Length: 5627

Received Cookies: (none)

Received Payload:
&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html lang="en-US"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Just a moment...&amp;lt;/title&amp;gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff2mgwirar8lx1ih41zij.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff2mgwirar8lx1ih41zij.webp" alt="A direct request to leetcode.com returns 403 with Cf-Mitigated: challenge" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reading the challenge response line by line
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Cf-Mitigated: challenge&lt;/code&gt;&lt;/strong&gt;: Cloudflare intercepted the request. &lt;code&gt;challenge&lt;/code&gt; means an interstitial; &lt;code&gt;block&lt;/code&gt; would be a hard refusal. The payload is only the shell of that interstitial, not the site.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;Negotiated protocol: HTTP/1.1&lt;/code&gt;&lt;/strong&gt;: browsers reach Cloudflare over HTTP/2 or HTTP/3. A client that stops at HTTP/1.1 announces itself before asking for any content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No cookies, 5.6 KB of HTML&lt;/strong&gt;: nothing useful was served. Retrying the same request gives the same 403, because nothing about it changed.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; a 403 with &lt;code&gt;Cf-Mitigated: challenge&lt;/code&gt; is not an IP ban and not a rate limit. It's a fingerprint verdict: the request didn't look like a browser, so the WAF answered with a challenge instead of the site.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The four signals a WAF scores
&lt;/h2&gt;

&lt;p&gt;Tool names change; the signals don't.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The TLS ClientHello (JA3 and JA4)
&lt;/h3&gt;

&lt;p&gt;The first packet of a TLS connection lists the client's cipher suites, extensions and parameters in a specific order. Summarized and hashed, that's the client's TLS fingerprint. &lt;a href="https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967/" rel="noopener noreferrer"&gt;JA3&lt;/a&gt; was the classic format; JA4 is the more readable successor WAFs increasingly use. Chrome, Firefox and Safari each have a stable, known fingerprint. The OpenSSL build in your runtime has a different one, and no header you set changes it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The HTTP/2 fingerprint
&lt;/h3&gt;

&lt;p&gt;Even after TLS passes, HTTP/2 has its own tells: SETTINGS frame values, the window update size, priorities, and the order of the &lt;code&gt;:method&lt;/code&gt;/&lt;code&gt;:path&lt;/code&gt;/&lt;code&gt;:authority&lt;/code&gt; pseudo-headers. Modern anti-bot systems score it next to TLS. A client that speaks HTTP/1.1 never gets this far.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Header order and client hints
&lt;/h3&gt;

&lt;p&gt;Browsers send a large, stable header set, including the &lt;code&gt;sec-ch-ua&lt;/code&gt; client hints, in a consistent order. Our challenge response even advertises this: its &lt;code&gt;Accept-Ch&lt;/code&gt; and &lt;code&gt;Critical-Ch&lt;/code&gt; headers list the hints a real browser is expected to send. A plain client has none, and a mismatched set (iPhone client hints with a desktop Chrome user-agent, for example) is its own red flag.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. IP reputation
&lt;/h3&gt;

&lt;p&gt;Datacenter ranges are cheap to rent and heavily used by both legitimate crawlers and abusers, so they start with a low score. Residential and mobile addresses start much higher.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; changing the user-agent fixes none of this. The user-agent is a text label; the TLS and HTTP/2 fingerprints come from the network stack underneath it. A Chrome label on an OpenSSL handshake is itself a signal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Libraries such as &lt;a href="https://github.com/lexiforest/curl_cffi" rel="noopener noreferrer"&gt;&lt;code&gt;curl_cffi&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;tls-client&lt;/code&gt; impersonate a browser handshake inside your HTTP client, which covers the first two signals. The impersonation has to stay coherent, though: a Chrome handshake from a datacenter IP in another country is weighed as a combination, not signal by signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The change that held up in our test
&lt;/h2&gt;

&lt;p&gt;Instead of impersonating Chrome in our own code, we sent the same request through our residential TLS gateway and let it present the handshake. Two things change at once: the request leaves from a residential address, and the ClientHello, cipher order and HTTP/2 SETTINGS frame match a captured Chrome build. The profile is picked in the proxy username:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Chrome 154 handshake on a US residential exit&lt;/span&gt;
curl --cacert ludax-ca.crt \
  -x &lt;span class="s2"&gt;"http://resi-USER-AE-chrome154:PASS-country-us@gw.ludaxproxy.com:9999"&lt;/span&gt; \
  -sS -o /dev/null \
  -w &lt;span class="s2"&gt;"%{http_code} %{http_version}\n"&lt;/span&gt; \
  https://leetcode.com/
&lt;span class="c"&gt;# 200 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same call in Python, with plain &lt;code&gt;requests&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;proxy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"http://resi-USER-AE-chrome154:PASS-country-us@gw.ludaxproxy.com:9999"&lt;/span&gt;

&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"https://leetcode.com/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;proxies&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"https"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;proxy&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;verify&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ludax-ca.crt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# the gateway re-signs the site's certificate&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eight minutes after the 403, from the same host:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Address: https://leetcode.com/
Response code: 200
Negotiated protocol: HTTP/2.0

Set-Cookie: csrftoken=...; Path=/; SameSite=Lax; Secure
cf-cache-status: DYNAMIC
Server: cloudflare
Content-Type: text/html; charset=utf-8
Content-Length: 24139

Received Payload:
&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html lang="en-us"&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;LeetCode - The World's
Leading Online Programming Learning Platform&amp;lt;/title&amp;gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftpkrd1ybbn1ihfbe6x2o.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftpkrd1ybbn1ihfbe6x2o.webp" alt="The same request with a Chrome 154 TLS profile returns 200 over HTTP/2" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Same target, same host, almost the same minute: 200 over HTTP/2 with the real page, because the request now matches a known browser on a trusted address.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Heads-up:&lt;/strong&gt; to present a browser fingerprint, a TLS-emulation gateway has to open your HTTPS connection and re-sign the site's certificate, so your client must trust the gateway's CA. Apps that pin certificates will reject that; use a plain CONNECT proxy for those, which passes HTTPS through untouched.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  A crawling pattern that stays unblocked
&lt;/h2&gt;

&lt;p&gt;One passing request is not a scraper. Over thousands of requests, keep the story consistent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One identity per task.&lt;/strong&gt; Logins, checkouts and multi-step flows should ride a sticky session so the IP and browser profile never change mid-task. Broad scanning can rotate per request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the profile coherent.&lt;/strong&gt; If your code sends a mobile Safari user-agent, use an iOS Safari handshake, not desktop Chrome.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check your exit before blaming the WAF.&lt;/strong&gt; Confirm the IP, country and network your requests actually leave from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget your rate.&lt;/strong&gt; A perfect fingerprint at machine speed still trips rate rules. Back off on 429s and challenges, and retry later rather than harder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Match the locale when content varies.&lt;/strong&gt; Use exits in the country (or city) whose version of the page you need.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What a WAF bypass is not
&lt;/h2&gt;

&lt;p&gt;A fingerprint fix is not a skeleton key. Some sites challenge every visitor, some content only exists after JavaScript runs, and some pages sit behind authentication no proxy entitles you to. Respect the rules that apply to you: terms of service, robots directives and local law differ from site to site.&lt;/p&gt;

&lt;p&gt;Shortcuts age badly, too. Reusing a &lt;code&gt;cf_clearance&lt;/code&gt; cookie from a real browser works only until it expires or the fingerprint and IP it was issued to stop matching, usually within minutes. The durable approach is the one above: make every request one the WAF has no reason to question.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is bypassing Cloudflare legal?&lt;/strong&gt;&lt;br&gt;
It depends on what you access and where you are. Scraping public data is legal in many jurisdictions, but getting around a technical barrier can carry liability in others, and a site's terms may prohibit it. Crawl only data you're entitled to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do I get 403 while the site opens fine in my browser?&lt;/strong&gt;&lt;br&gt;
Your browser passes every transport check; your scraper fails them before any HTML loads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I bypass Cloudflare with headers alone?&lt;/strong&gt;&lt;br&gt;
No. Headers are text fields; the block is triggered by the TLS ClientHello and HTTP/2 behavior underneath. Chrome headers on an OpenSSL handshake make the mismatch worse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JA3 vs JA4?&lt;/strong&gt;&lt;br&gt;
Both summarize a ClientHello into a fingerprint. JA3 hashes selected fields in order; JA4 keeps parts readable, sorts ciphers and extensions, and ignores GREASE, which makes it more stable and easier to allowlist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a residential IP alone get past the WAF?&lt;/strong&gt;&lt;br&gt;
It helps, but it doesn't fix a fingerprint mismatch. HTTP/1.1 with a library TLS stack can be challenged on that alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I still need a headless browser?&lt;/strong&gt;&lt;br&gt;
Not always. If fingerprint, protocol and IP are coherent, a plain HTTP client often passes, as here. Sites that build their data in JavaScript still need a browser.&lt;/p&gt;




&lt;p&gt;Want to see what your own scraper looks like to a WAF? We open-sourced the checker we use for this: &lt;a href="https://github.com/LudaxProxy/scraper-leak-check" rel="noopener noreferrer"&gt;scraper-leak-check&lt;/a&gt; prints your IP, JA4/JA3 and header order, through any proxy.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://ludaxproxy.com/blog/cloudflare-waf-bypass" rel="noopener noreferrer"&gt;ludaxproxy.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>python</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
