Information Disclosure in Version Control History
An exposed .git directory allowed downloading the full repository history, where a commit that removed a hard-coded admin password still contained the password in its diff. The attacker used that password to log in as administrator and delete a user.
medium.com
Published on medium.com
When a .git directory is accidentally deployed alongside a web application and left publicly accessible, an attacker can download the entire repository — not just the current state of the code, but every commit ever made. This means:
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
The .git directory was deployed with the public web files, exposing the full version control history including a removed hard-coded password.
Impact
An attacker could recover a deleted admin password and gain full administrative access, including deleting users.
What the attacker needed
Publicly accessible .git directory; no authentication required
How it was found
- Browse to /.git to confirm the Git directory is publicly accessible.
- Download the entire .git directory recursively to a local machine.
- Open the downloaded repository locally and inspect the commit log.
- Find the commit titled 'Remove admin password from config' and inspect its diff.
- Recover the hard-coded admin password from the removed line in the diff.
- Log in as administrator and delete the user carlos.
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 .git folder is part of a code project that tracks every change ever made. If it is left on a public website, anyone can download it and see old versions of files, including secrets that were later removed. Here, an old admin password was still readable in the history, so the attacker could log in as the administrator.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.