You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-challenges/challenge-types/challenge-pages/additional-configuration.mdx
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,18 @@ You can customize your favicon by using the HTML snippet below.
17
17
18
18
```html title="HTML element"
19
19
<linkrel="shortcut icon"href="<FAVICON_LINK>" />
20
-
```
20
+
```
21
+
22
+
## Custom Content Security Policy (CSP) and error pages
23
+
24
+
Cloudflare-served Challenge Pages operate in a strictly controlled environment to maximize security and ensure the challenge mechanism functions correctly. Because of this, you cannot set your own Content Security Policy (CSP) or Referer-Policy using `<meta>` tags or Transform Rules on Challenge Pages. Origin headers can be modified within the Challenge Page context and are not immutable, but they may cause issues.
25
+
26
+
If you have an active Transform Rule configured to modify HTTP response headers globally across your website, such as adding custom CSP headers, this rule will interfere with and cause the Challenge Page to fail.
27
+
28
+
To prevent this conflict, you must modify your Transform Rule expression to explicitly exclude Challenge Page error types. Prefix your Transform Rule expression with the following logical exclusion:
29
+
30
+
```txt wrap
31
+
not cf.response.error_type in {"managed_challenge" "iuam" "legacy_challenge" "country_challenge"}
32
+
```
33
+
34
+
This exclusion ensures that your custom header modification logic is only applied to traffic destined for your origin, allowing Cloudflare's Challenge Platform to function without being impacted by conflicting response headers.
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-challenges/challenge-types/challenge-pages/index.mdx
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,3 +44,13 @@ With a JavaScript (JS) Challenge, Cloudflare makes the determination on whether
44
44
The visitor must wait until their browser finishes processing the JavaScript, which typically takes less than five seconds.
45
45
46
46
If the visitor passes the Challenge, the original request continues to the destination URL. If the Challenge fails or cannot be completed, the visitor is presented with another Interstitial Challenge Page.
47
+
48
+
## Compatibility limitations
49
+
50
+
Challenge Pages interrupt the request flow by returning a full HTML page for the user's browser to render and solve. This mechanism fails when the browser expects a non-HTML response, such as an AJAX or XHR (fetch) request.
51
+
52
+
To ensure your API calls are protected without breaking single-page applications (SPAs) or API integrations, Cloudflare recommends using Turnstile Pre-clearance.
53
+
54
+
By enabling Pre-clearance, the Turnstile widget issues a persistent clearance cookie (`cf_clearance`) upon successful human verification on an initial HTML page. This cookie pre-clears the visitor to interact with sensitive API endpoints secured by WAF rules, allowing you to deploy granular security without forcing a disruptive Challenge Page response.
55
+
56
+
For implementation details, refer to the [guidance on Pre-clearance for Turnstile](/cloudflare-challenges/concepts/clearance/#pre-clearance-support-in-turnstile).
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-challenges/reference/challenge-solve-rate.mdx
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,3 +27,41 @@ You can find the CSR of a rule by going to its corresponding dashboard page:
27
27
For [custom rules](/waf/custom-rules/) or [rate limiting rules](/waf/rate-limiting-rules/), go to your zone > **Security** > **Security rules**.
28
28
29
29
</TabItem> </Tabs>
30
+
31
+
---
32
+
33
+
## Challenge actions in Security Events
34
+
35
+
If you find a Challenge Solved action, such as `[js]challengeSolved` or `challengeSolved`, in your Security Events that does not seem to match the underlying rule criteria, it is because this action refers to the successful mitigation of a previous request.
36
+
37
+
The Challenge lifecycle involves two distinct events, which are crucial for interpreting your logs:
38
+
39
+
- Challenge trigger: The original request matched a WAF custom rule with a Challenge action. This request contains the suspicious parameters that triggered the rule.
40
+
- Challenge solved: The client's browser sends back a subsequent request containing the validated solution. This action is logged as Challenge Solved.
41
+
42
+
The parameters of the solved request may no longer match the original rule's expression. For example, if a Challenge was issued due to a low Bot Score, the score for the solved request may have already changed to a non-suspicious value upon successful verification.
43
+
44
+
The Challenge Solved action is purely an informative signal that a previously issued Challenge was answered, allowing the visitor's traffic to proceed. It does not imply that the subsequent request re-matched the initial trigger rule.
45
+
46
+
---
47
+
48
+
## Failed Challenges
49
+
50
+
You will not find a dedicated metric for failed Challenges in Security Analytics because Cloudflare calculates failure indirectly, based on the difference between Challenges issued and Challenges solved.
51
+
52
+
The system views any issued Challenge that does not result in a successful clearance cookie as a failure. This is why the number of failed Challenges may appear exceptionally high: the majority of issued Challenges are never completed.
53
+
54
+
The official calculation for failures is:
55
+
56
+
```txt
57
+
Failed Challenges = Total Challenges Issued − Total Challenges Solved
58
+
```
59
+
60
+
The large number of unmatched Challenges is primarily due to automated traffic (bots or scrapers) that abandon the process immediately upon encountering the initial Challenge script.
61
+
62
+
Key reasons a Challenge may be issued but never solved:
63
+
64
+
- The visitor gives up on the Challenge or navigates away from the page.
65
+
- The visitor attempts to solve the Challenge but cannot provide a valid answer.
66
+
- The system receives an invalid or malformed answer from the client.
67
+
- The script environment (often a bot's controlled browser) fails to run the necessary client-side checks.
Cross-origin resource sharing (CORS) preflight requests, or `OPTIONS`, exclude user credentials that include cookies. As a result, the `cf_clearance` cookie will not be sent with the request, causing it to fail to bypass a Challenge Page (Non-interactive, Managed, or Interactive Challenge).
31
+
Cross-origin resource sharing (CORS) preflight requests, or `OPTIONS`, exclude user credentials that include cookies. As a result, the `cf_clearance` cookie will not be sent with the request, causing it to fail to bypass a Challenge Page (Non-interactive, Managed, or Interactive Challenge).
32
+
33
+
### Challenges on Cloudflare-protected sites
34
+
35
+
Cloudflare issues Challenges to website visitors to protect against malicious activity, such as bot attacks and DDoS attempts. If a legitimate human visitor is unexpectedly challenged, the reason typically stems from a security feature flagging their request.
36
+
37
+
| Source | Description |
38
+
| --- | --- |
39
+
| High threat score | IP addresses with a high-risk score trigger Challenges. |
40
+
| IP reputation | If your IP has a history of suspicious activity, it may be flagged. |
41
+
| Bot detection | Automated traffic resembling bots is filtered by Cloudflare. |
42
+
| Web Application Firewall (WAF) custom rules | Site owners may set rules targeting specific regions or user agents. |
43
+
| Browser Integrity Check | Cloudflare verifies that browsers meet certain standards. |
44
+
| Challenge Passage | Technologies like Privacy Pass reduce the frequency of repeated Challenges. |
45
+
46
+
To avoid repeated Challenges, visitors can take the following steps to ensure their environment does not trigger security checks:
47
+
48
+
- Ensure your web browser is updated to the latest stable version for full compatibility with modern challenge technologies.
49
+
- Temporarily disable browser extensions, such as ad blockers or privacy tools, that may block standard browser headers or the necessary Challenge scripts.
50
+
- If your IP address has a poor reputation (often seen with shared VPNs or corporate proxies), try switching to a different, trusted network connection.
51
+
52
+
### Allowlist traffic from mitigation actions
53
+
54
+
If you need to prevent a **Block** or **Challenge** action from being applied to specific requests, such as known search engine crawlers, monitoring services, or internal APIs, you must configure an exclusion using [WAF custom rules](/waf/custom-rules/).
55
+
56
+
Cloudflare supports two primary methods for creating these exclusions:
57
+
58
+
#### 1. Use a Skip rule (recommended)
59
+
60
+
The most robust method for creating an exception is to create a custom rule with the **Skip** action. This allows matching requests to bypass certain security features, including Bot Management and other WAF rules.
61
+
62
+
:::note
63
+
Due to the evaluation order, **Skip** rules must be positioned before the **Block** or **Challenge** rule they are designed to bypass.
64
+
:::
65
+
66
+
<Detailsheader="Example">
67
+
68
+
Block Amazon Web Services (AWS) and Google Cloud Platform (GCP) because of large volumes of undesired traffic, but allow Googlebot and other known bots that Cloudflare validates.
69
+
70
+
- Basic rule, no exclusion:
71
+
72
+
-**Expression**: `(ip.src.asnum in {16509 15169} and not cf.client.bot)`
73
+
-**Action**: Block (or a challenge action)
74
+
75
+
- Rule that excludes IP addresses from being blocked or challenged:
76
+
77
+
-**Expression**: `(ip.src.asnum in {16509 15169} and not cf.client.bot) and not (ip.src in {192.0.2.1 198.51.100.42 203.0.113.0/24})`
78
+
-**Action**: Block (or a challenge action)
79
+
80
+
- Two rules to skip remaining custom rules for specific IPs and block the rest.
81
+
82
+
1. Rule 1:
83
+
84
+
- Expression: `ip.src in {192.0.2.1 198.51.100.42 203.0.113.0/24}`
85
+
- Action: Skip > All remaining custom rules
86
+
87
+
2. Rule 2:
88
+
89
+
- Expression: `(ip.src.asnum in {16509 15169} and not cf.client.bot)`
90
+
- Action: Block (or a challenge action)
91
+
</Details>
92
+
93
+
#### 2. Modify the Rule Expression
94
+
95
+
You can refine the expression of a **Block** or **Challenge** rule to directly exclude known good traffic by using the logical not operator with an exclusion list, such as an IP list, country code, or ASN.
96
+
97
+
This approach is useful for simple exclusions but can make complex rules more difficult to maintain than separate **Skip** rules.
98
+
99
+
<Detailsheader="Example">
100
+
101
+
Exclude multiple IP addresses from a **Block** or **Challenge** rule that assesses attack score.
102
+
103
+
- Basic rule, no exclusion:
104
+
105
+
-**Expression**: `(http.host eq "example.com" and cf.waf.score lt 20)`
106
+
-**Action**: Block (or a challenge action)
107
+
108
+
- Rule that excludes IP addresses from being blocked/challenged:
109
+
110
+
-**Expression**: `(http.host eq "example.com" and cf.waf.score lt 20) and not (ip.src in {192.0.2.1 198.51.100.42 203.0.113.0/24})`
111
+
-**Action**: Block (or a challenge action)
112
+
113
+
- Two rules to skip remaining custom rules for specific IPs and block the rest.
114
+
115
+
1. Rule 1:
116
+
117
+
- Expression: `ip.src in {192.0.2.1 198.51.100.42 203.0.113.0/24}`
118
+
- Action: Skip > All remaining custom rules
119
+
120
+
2. Rule 2:
121
+
122
+
- Expression: `(http.host eq "example.com" and cf.waf.score lt 20)`
Copy file name to clipboardExpand all lines: src/content/docs/support/troubleshooting/general-troubleshooting/potential-isp-blocking.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,4 +15,4 @@ Enterprise users can lease [static IPs](/byoip/concepts/static-ips/) or get thei
15
15
16
16
It is important to note that an ISP-level block is distinct from other types of website blocking. For example, website owners may enforce certain restrictions (based upon IP, ASN, country, or other factors such as rate limiting) that will return [`1XXX` errors](/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/) in the HTML body of the response. Website owners configure these blocks, so issues need to be addressed directly with the website owner. For more information on website blocking, refer to the [Web Application Firewall FAQ](/waf/troubleshooting/faq/#why-have-i-been-blocked).
17
17
18
-
For information on individual users being challenged when visiting Cloudflare-protected websites, refer to [Challenges FAQ](/cloudflare-challenges/frequently-asked-questions/#why-am-i-being-challenged-on-a-cloudflare-protected-site).
18
+
For information on individual users being challenged when visiting Cloudflare-protected websites, refer to [Challenges on Cloudflare-protected sites](/cloudflare-challenges/troubleshooting/#challenges-on-cloudflare-protected-sites).
0 commit comments