Skip to content
Info disclosure Write-up Beginner

Exposure Protocol: Information Disclosure in the Wild [Part 3]

A web application exposed a backup Java source file in a publicly accessible /backup directory listed in robots.txt. The file contained a hard-coded Postgres database password, which an attacker could read and use to access the database.

medium.com

Published on medium.com

Welcome back to Exposure Protocol, a series diving deep into real-world Information Disclosure bugs that often get overlooked — until someone smart enough pokes in the right place.

Aditya Bhatt, 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, backup files were left in a web-accessible directory and robots.txt disclosed the directory path, while the source code contained hard-coded credentials.

Impact

An attacker could obtain the database password and potentially access or compromise the entire database, though this is demonstrated only in a lab environment.

What the attacker needed

None

The fix

The backup files should be removed from the web-accessible directory, robots.txt should not disclose sensitive paths, and credentials should not be hard-coded in source code.

How it was found

  1. Open the robots.txt file of the site.
  2. Notice a disallowed path pointing to a backup directory.
  3. Browse to the backup directory and list its files.
  4. Open the backup Java source file.
  5. Find the hard-coded Postgres database password in the source code.
  6. Submit the extracted password to solve the lab.

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 backup file is an old copy of source code that should not be on a live website. Here, the site listed a hidden folder in a file meant for search engines, and that folder contained a backup of the code with a database password written directly inside it. Anyone who found the file could read the password and log in to the database.

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.