How an Exposed .git Directory Left a Scientific Observatory Vulne
A public web server for a scientific observatory served its .git version control directory, allowing anyone to read commit logs and reconstruct the full source code history. An attacker could then extract proprietary backend code and any secrets accidentally committed in the past.
Published on medium.com
During a routine open-source intelligence (OSINT) and reconnaissance exercise, I uncovered a significant security misconfiguration on a public domain belonging to the HAWC (High-Altitude Water Cherenkov) Gamma-Ray Observatory — a facility backed by the U.S. Department of Energy and the National Science Foundation.
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 not configured to deny access to hidden files such as the .git directory, which had been deployed into the public web root.
Impact
An attacker could obtain the full source code and any credentials or tokens left in the repository history, though the report does not claim that any secret was actually found or used.
What the attacker needed
None
The fix
The exposure was fixed by the administrators, and the report recommends blocking hidden files at the web server and deploying only build artefacts rather than a live Git clone.
How it was found
- Send a request to the .git/logs/HEAD path on the target domain.
- Observe that the server returns HTTP 200 OK and prints the raw Git commit log.
- Use a tool such as git-dumper to fetch the .git/index and object files.
- Reconstruct a local clone of the repository and inspect the source code and history for secrets.
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.
When developers deploy a website, they sometimes copy the whole project folder, including a hidden folder called .git that stores the entire history of the code. If the web server is not told to block access to that folder, anyone can download it and rebuild the source code. This report shows a real site that left that folder open.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.