Skip to content
Info disclosure Write-up Beginner

The Password They Deleted But Never Erased

A web server exposed its .git directory, allowing an attacker to download the full repository history. The history contained a hardcoded admin password that had been deleted in a later commit, which the attacker used to log in and delete a user.

guyani Follow

Published on medium.com

So far in this series the secrets have been sitting in the open — in robots.txt, in error messages, in HTML comments. This one is sneakier.

morgan_hack, 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

Impact

An attacker could recover the deleted admin password and gain full administrative access, allowing them to delete users.

What the attacker needed

None

The fix

The .git directory should not be deployed to production, and secrets should never be hardcoded in source; if exposed, history should be rewritten and credentials rotated.

How it was found

  1. Run content discovery to find hidden paths on the site.
  2. Notice that the .git/HEAD path returns 200, indicating the folder is exposed.
  3. Confirm the whole .git folder is browsable by checking another file.
  4. Download the entire .git folder recursively.
  5. Read the Git log to see commit messages, including one about removing an admin password.
  6. Show the earlier commit where the password was added to reveal it.

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.

Git is a tool that saves every change to code, like a permanent undo history. If a password is written into a file and later deleted, the old version with the password still exists in that history. Here the server accidentally made the whole history folder public, so anyone could download it and read the old password.

What is Info disclosure?

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

More by guyani

View all

6 more disclosed reports, best first.

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.