How I Turned a 403 Forbidden Into a 200 OK
A subdomain returned 403 Forbidden on its root path, but the /config directory was not protected and allowed directory listing and access to nginx.conf. An attacker could download the nginx configuration, exposing server blocks, internal routes, backend IPs and security rules.
medium.com
Published on medium.com
Every bug bounty hunter knows the pain of hitting a 403 forbidden .Sometimes it means “nothing here”. But sometimes… it hides gold.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an access-control rule was applied only to the root path, leaving the /config directory unprotected and browsable.
Impact
The exposed nginx.conf could reveal server blocks, internal routes, proxy configurations, backend IP addresses, log paths and security rules, which may lead to further attacks.
What the attacker needed
Subdomain enumeration; no authentication needed
How it was found
- Find a subdomain during subdomain enumeration and open it in a browser.
- Observe that the root path returns 403 Forbidden.
- Try common 403 bypass techniques such as method changes, path encoding, slash tricks, random headers, X-Forwarded-For, cache header bypass and URL casing.
- Fuzz the root path again and discover that /config returns 200 OK.
- Fuzz inside /config and find that /config/nginx.conf returns 200 OK.
- Open /config/nginx.conf in the browser and download the nginx configuration file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A 403 error means the server refuses to show a page. The hunter found that while the main page was blocked, a folder called /config was left open, and it contained the server's configuration file. That file can reveal how the server is built and where internal services live.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.