Skip to content

Commit 207ba96

Browse files
[Challenges] FAQ to docs (#25686)
* FAQ to docs * delete faq page * challenges redirect section * broken links * title * move section * feedback
1 parent cddecbd commit 207ba96

File tree

11 files changed

+167
-128
lines changed

11 files changed

+167
-128
lines changed

public/__redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@
363363
/realtime/introduction/ /realtime/realtimekit/introduction/ 302
364364
/realtime/concepts/ /realtime/realtimekit/concepts/ 302
365365

366+
# Cloudflare Challenges
367+
/cloudflare-challenges/frequently-asked-questions/ /cloudflare-challenges/ 301
368+
366369
# china network
367370
/support/about-cloudflare/enterprise-documentation/understanding-and-configuring-an-icp-number/ /china-network/concepts/icp/ 301
368371
/china-network/concepts/china-express/ /china-network/concepts/global-acceleration/ 301

src/content/docs/cloudflare-challenges/challenge-types/challenge-pages/additional-configuration.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@ You can customize your favicon by using the HTML snippet below.
1717

1818
```html title="HTML element"
1919
<link rel="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.

src/content/docs/cloudflare-challenges/challenge-types/challenge-pages/detect-response.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ fetch("/my-api-endpoint").then((response) => {
2323
// Process response as usual
2424
}
2525
});
26-
```
27-
28-
For additional help, refer to our [FAQ](/cloudflare-challenges/frequently-asked-questions/).
26+
```

src/content/docs/cloudflare-challenges/challenge-types/challenge-pages/index.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ With a JavaScript (JS) Challenge, Cloudflare makes the determination on whether
4444
The visitor must wait until their browser finishes processing the JavaScript, which typically takes less than five seconds.
4545

4646
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).

src/content/docs/cloudflare-challenges/challenge-types/turnstile.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ The sitekey is used with [client-side rendering](/turnstile/get-started/client-s
3535

3636
## Get started
3737

38-
Refer to the [Turnstile documentation](/turnstile/get-started/) for guidance on implementing a widget to your website or application.
38+
Refer to the [Turnstile documentation](/turnstile/get-started/) for guidance on implementing a widget to your website or application.

src/content/docs/cloudflare-challenges/frequently-asked-questions.mdx

Lines changed: 0 additions & 117 deletions
This file was deleted.

src/content/docs/cloudflare-challenges/reference/challenge-solve-rate.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,41 @@ You can find the CSR of a rule by going to its corresponding dashboard page:
2727
For [custom rules](/waf/custom-rules/) or [rate limiting rules](/waf/rate-limiting-rules/), go to your zone > **Security** > **Security rules**.
2828

2929
</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.

src/content/docs/cloudflare-challenges/reference/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pcx_content_type: navigation
33
title: Reference
44
sidebar:
5-
order: 4
5+
order: 3
66
group:
77
hideIndex: true
88
---

src/content/docs/cloudflare-challenges/troubleshooting/index.mdx

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
pcx_content_type: troubleshooting
33
title: Troubleshooting
44
sidebar:
5-
order: 5
5+
order: 4
66
label: Common issues
77
---
88

9-
import { Render } from "~/components"
9+
import { Render, Details } from "~/components"
1010

1111
## Common issues
1212

@@ -28,4 +28,97 @@ You can add tracking scripts to Challenge Pages to capture the correct referer h
2828

2929
### Cross-origin resource sharing (CORS) preflight requests
3030

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).
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+
<Details header="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+
<Details header="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)`
123+
- Action: Block (or a challenge action)
124+
</Details>

src/content/docs/support/troubleshooting/general-troubleshooting/potential-isp-blocking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Enterprise users can lease [static IPs](/byoip/concepts/static-ips/) or get thei
1515

1616
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).
1717

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

Comments
 (0)