Skip to content
Info disclosure Write-up Beginner

Exploring docker-compose.yaml leads to sensitive disclosure

A publicly reachable environment file and a docker-compose file exposed production database and Redis connection details. The hunter used the disclosed port to connect directly to the production database and found credentials, PayPal identifiers and administrator access.

medium.com

Published on medium.com

Today i was explore on my target site, suddenly i was found a .env-prod that show for the database connection.

Muhamad Raidinoor Pasha, on medium.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 sensitive configuration files were deployed to a public web directory and the database port was exposed to the internet.

Impact

The exposed database gave access to credentials, PayPal client and secret identifiers, a webhook identifier and full administrator access.

What the attacker needed

No account needed; database port reachable from internet

The fix

Sensitive configuration files should be removed from public web directories and the database and Redis ports should not be reachable from the internet.

How it was found

  1. Browse the target site and find a publicly accessible environment file showing database connection details.
  2. Try to connect to the database on the default port, which fails because the port is closed.
  3. Search the site again and find a publicly accessible docker-compose file.
  4. Read the database and Redis ports listed in that file.
  5. Connect to the production database on the newly found port.

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.

Some websites leave configuration files lying in public folders. These files can contain the address, username and password for the site's database. If the database is also reachable from the internet, anyone who reads the file can log in and read or change everything.

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.