How I Earned $1,000 Bounty by Exploiting a Simple Misconfiguration
An exposed .git directory allowed the source code to be reconstructed, revealing database credentials, WordPress salts, API keys and SQL dumps. An attacker could use these to compromise the WordPress application and its data.
Published on medium.com
Here’s how I found a small yet high-impact vulnerability that led to my first $1,000 bounty, along with the key lessons I learned from it.
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 web server was misconfigured to serve the .git directory, exposing version-control metadata and the secrets stored in the source code.
Impact
An attacker could take over the database, hijack sessions, decrypt sensitive information and expose personally identifiable information, effectively compromising the entire application.
What the attacker needed
Exposed .git directory on the web server
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 directory is a hidden folder that version-control software Git uses to store the history of a website's code. If it is left publicly accessible, anyone can download it and rebuild the source code, including files that hold passwords and secret keys. Here, that mistake exposed database credentials and other secrets, which could let an attacker take over the site.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.