Skip to content
Info disclosure Write-up Beginner

easy $100 | bypass 403 to 200 ok

A production .env file was exposed on an origin server that was reachable directly, bypassing the Cloudflare WAF that blocked access via the normal hostname. An attacker could read database credentials, session signing keys and internal API routes.

infosecwriteups.com

Published on infosecwriteups.com

can you even imagine what most people do? they do recon, burst out some payloads and think that’s bbh? naahh man, ill show you how a simple recon got me $100

Swarnim Bandekar, on infosecwriteups.com

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 the origin server was directly reachable from the internet and served the .env file without access control, so the WAF could be bypassed by connecting to the origin IP.

Impact

An attacker could read production secrets such as database credentials and session signing keys, potentially reaching backend systems, with no WAF filtering or rate limiting in the way.

What the attacker needed

Origin server reachable directly; Shodan or similar to find origin IP; no authentication on .env

The fix

The report was fixed quickly after being reported.

How it was found

  1. Search Shodan for the target domain to find exposed hosts.
  2. Visit the subdomain found and observe an empty page.
  3. Run directory fuzzing with a common wordlist and find /.env returns 403.
  4. Request /.env via the normal hostname and get blocked by Cloudflare.
  5. Access the application through the origin IP found via Shodan.
  6. Request /.env through the origin IP and receive a 200 OK with the file contents.

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 website often sits behind a protective service (a WAF) that blocks suspicious requests. But if the actual server behind that protection can be found and reached directly, the protection is skipped entirely. Here, the server's real address was found via a search engine for internet-connected devices, and a secret configuration file was then downloadable.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.