How a Simple .git/config Check Earned Me $1000
The web server exposed the .git directory, allowing the entire Git history and source code to be downloaded. An attacker could then recover secrets such as database passwords and API keys committed to the repository.
medium.com
Published on medium.com
One fine evening, as I was sipping my coffee and mindlessly probing random websites (like every other bored bug bounty hunter), I accidentally hit gold — or more accurately, I hit /.git/config and it said "Download me!" like a clingy ex.
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 deployment process copied the .git directory into the public web root instead of excluding it.
Impact
An attacker could reconstruct the full source code and obtain database credentials, API keys and access tokens, which could enable further attacks.
What the attacker needed
None
How it was found
- Request the .git/config path on the target website and observe a 200 response.
- Use a tool to dump the exposed .git directory to a local folder.
- Inspect the recovered Git history for committed secrets and internal endpoints.
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 a hidden directory that version control software keeps on a server. If a website serves it publicly, anyone can download the project's history and any passwords or keys that were saved in it.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.