Cloudflare error 1020 “Access denied” means a rule configured in the zone — a WAF custom rule or an IP access rule — matched the request and its action was Block. Nothing is broken: Cloudflare did exactly what someone told it to do, possibly years ago. If it is your site, the fix is finding the matching rule in Security → Events using the Ray ID from the error page, then narrowing the rule so it stops catching legitimate traffic. If it is someone else’s site, only that site’s operator can unblock you — send them the Ray ID.
What’s happening
Every request to a proxied hostname passes through the zone’s security layer at the Cloudflare edge before anything is fetched from the origin. That layer evaluates, among other things, IP access rules, WAF custom rules, and managed rulesets. When a rule with the Block action matches, the edge stops right there — the origin never sees the request — and returns a 403 status with the branded 1020 page, including a Ray ID that uniquely identifies the event. The 1020 code specifically indicates a block by zone-level rules, as opposed to other Cloudflare 403 variants (IP bans, Browser Integrity Check) that carry their own 1xxx codes. The rule engine and its actions are documented in Cloudflare’s WAF documentation.
The critical distinction when you see a bare 403: Cloudflare-generated blocks come with the Cloudflare-styled page and an error code; a 403 with your application’s or web server’s own error page passed through Cloudflare untouched — that one is origin-side (ModSecurity, .htaccess deny rules, application permissions) and no dashboard setting caused it. WAF custom rules exist on all plans; higher plans mainly add more rules and more expression features, so nothing here is out of reach on Free or Pro. One naming note when searching for help: “Firewall Rules” is the legacy name — the current system is WAF custom rules, and old blog-post advice about the Firewall tab maps to Security → WAF.
What to check first
- Grab the Ray ID from the error page (bottom of the 1020 page). It is the key to everything else.
- Is the page Cloudflare-branded? If the 403 shows your app’s own error page, stop here and debug the origin instead.
- Who is affected? Just you, one office IP, one country, or everyone? The blast radius usually mirrors the rule’s expression.
- What changed recently? A new custom rule, a country block added during an attack, or a “temporary” IP rule from last quarter.
- Are automated clients the victims? Webhooks, uptime monitors, and payment callbacks are the most common accidental catches.
How to verify
Confirm where the 403 is generated, then look up the event:
# Status and Cloudflare headers through the proxy
curl -sI https://example.com/ | grep -iE 'HTTP/|cf-ray|cf-mitigated|server'
# Same URL straight to the origin (IP from DNS -> Records):
# if the 403 persists here, it is origin-side, not a Cloudflare rule
curl -s -o /dev/null -w '%{http_code}\n' --resolve example.com:443:203.0.113.10 https://example.com/
# See the block body Cloudflare serves (contains "error code: 1020")
curl -s https://example.com/ | grep -io 'error code: 10[0-9][0-9]'
Then in the dashboard: Security → Events, set the time window, and filter by the Ray ID (or by IP, country, or URI path). The event detail names the exact service (WAF custom rule, IP access rule, managed rule) and the rule that matched — no guessing required. That log is sampled at high volumes, but a specific Ray ID lookup lands on the exact event.
The fix
- Narrow the over-broad custom rule — the most common case: an expression like “country is X” or “URI contains
/wp-” written during an incident and never revisited. Edit it under Security → WAF → Custom rules to add the missing conditions (path, method, ASN, verified bot status) so it matches the attack, not the customers. Expression patterns worth stealing are in WAF custom rules: block, challenge, log, skip. - Remove or expire stale IP access rules — Security → WAF → Tools → IP Access Rules. Blocks added by hand during old incidents outlive their purpose; anything without a documented reason should go.
- Add a skip rule for legitimate automation — webhooks (Stripe, PayPal), monitors, and API partners get caught constantly. Create a custom rule with the Skip action, scoped as tightly as possible: their documented IP ranges or a signed header, plus the exact path. Do not allowlist the whole internet’s user-agent strings — those are forgeable.
- Rethink country blocking — if the business serves customers in a blocked country, replace Block with Managed Challenge so humans pass and bots do not. Challenge is usually the right tool where Block is a sledgehammer.
- Downgrade the action while you investigate — switching a suspect rule’s action to Log (or Managed Challenge) keeps visibility in Security Events without turning users away, which makes the false-positive rate measurable before you decide.
When this fix is wrong
If Security Events shows no matching event for the Ray ID and timestamp, Cloudflare rules did not block the request — look at origin-side controls (ModSecurity, fail2ban serving 403s, application ACLs) or at a rate limiting rule instead, which returns 429 rather than 403 in the standard case (see rate limiting rules and thresholds). And if you are the visitor, not the operator: no VPN toggle or cookie clearing reliably beats a deliberate block — contacting the site with your Ray ID is the legitimate path.
Common mistakes
- Disabling the entire WAF or deleting all custom rules to unblock one user — the rules were doing real work against real noise; fix the one expression instead.
- Allowlisting by user-agent, which any attacker can copy in one header.
- Treating every 403 as Cloudflare’s doing and burning an afternoon in the dashboard while the origin’s ModSecurity was the author all along.
- Leaving “temporary” incident rules active for years with no naming convention or expiry note, until nobody remembers what is safe to remove.
Prevention
- Name every custom rule with a date and a reason (
2026-07 ticket-1423 block scraper ASN), so audits take minutes. - Review Security Events monthly for the top blocked paths and IPs — false positives cluster and announce themselves.
- Prefer Managed Challenge over Block wherever a human could plausibly be on the other end.
- Document the skip rules that protect webhooks and monitors, and test those paths after any security change.
- Keep a habit of asking users who report blocks for the Ray ID — it turns a vague complaint into a thirty-second lookup.
A 1020 is a configuration statement, not a malfunction — the only question is whether today’s configuration still says what you mean. If the error keeps coming back, the problem usually sits between Cloudflare and the origin — Stack Harbor operates that whole path under Managed Cloud Ops, and you can book an infrastructure review.