Skip to content
4xx · client errorSent by App | CDN | Proxy

403Forbidden

The server understood the request and refuses it. Logging in again will not help.

How you get a 403

The request carries a valid login, so the app knows who is asking. The account lacks permission for this page, and the app sends 403. Sending the same credentials again changes nothing.

Who sends itApp · CDN · Proxy

  1. Browser
  2. CDN
  3. Proxy
  4. App
  5. DB

Typically the app, when the user lacks permission. The CDN or proxy sends it when a firewall rule, IP block or bot check stops the request before it reaches the app.

In short

What a 403 Forbidden means

A 403 Forbidden means the server understood exactly what was asked and decided not to do it. Unlike a 401, identity is not the issue: either the server knows who is asking and that account is not allowed, or the refusal has nothing to do with accounts at all. Two very different boxes send it. The application sends 403 for permissions: the wrong role, someone else's record, a missing CSRF token. The CDN or proxy sends 403 for policy: a firewall rule, a blocked country or IP address, a bot check. In the second case the request never reaches the app, and the app's logs show nothing. Repeating the request with the same credentials gets the same answer, so automatic retries are pointless.

Common causes of a 403

  1. 1The account is authenticated but lacks the role or ownership the app requires.

    How to check: Try the same request as an admin. If that works, it is a permission.

  2. 2A firewall, bot check or IP block at the CDN or proxy.

    How to check: The block page is the vendor's, and the Server header names it.

    curl -sI https://example.com/ | grep -iE 'server|cf-ray'
  3. 3The web server will not list a directory, or cannot read the file.

    How to check: nginx names it in the error log.

    directory index of "/var/www/html/" is forbidden
  4. 4A form was submitted without a valid CSRF token.

    How to check: The session expired or the page was cached. Reload the form and submit again.

  5. 5Object storage hides whether a file exists from callers who cannot list the bucket.

    How to check: Confirm the object's key exists. A missing file can come back as 403 here.

Retry or not?

Never auto-retry

The server made a decision and the same request will get the same decision. Change the permissions, the rule or the account. Automatic retries only add noise and can look like an attack.

Headers that matter

Server / cf-ray
Shows whether the app or an edge product refused. With a CDN block, quote the ray ID to whoever manages the firewall.
WWW-Authenticate
Not sent on a 403. Its absence is the hint that new credentials are not what is being asked for.

In the real world

RFC vs real deployments

RFC 9110 says a 403 means the server refuses, that credentials, if any were sent, are not enough, and that the client should not simply repeat the request. It also allows a server to answer 404 instead, to avoid confirming that the resource exists; GitHub does this for private repositories. In the other direction, some services send 403 where the RFC would suggest 401 or 429, for missing tokens or rate limits.

Seen in a real outage

The permission check behind a 403 is the thing that must not be skipped. In 2016 researchers opened millions of private files shared through short links, because knowing the link was the only check.

Your turn

Which code is it?

Customers in one country get a 403 page branded by your CDN. Your app's access log has no entries for their requests. Where should you look?

Often confused with

403 questions

Who sends a 403 Forbidden?
Typically the application, when the account lacks permission. A CDN or proxy sends it when a firewall rule, IP block or bot check stops the request before the app sees it.
How do I fix a 403?
Find out who refused. If it is the app, the account needs the right permission. If the page is your CDN's or host's, a firewall or access rule is blocking the request.
What is the difference between 403 and 404?
A 403 admits the resource is there and refuses access. A 404 says nothing is there. Some servers send 404 instead of 403 on purpose, to hide what exists.

Sources: RFC 9110: 403 Forbidden (section 15.5.4) ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track