My First Valid Bugs
An exposed .git directory on a subdomain let anyone download the site's source code and history. Separately, an API key and secret were committed to a public GitHub repository.
Published on infosecwriteups.com
Hello Folks, I am Jaydev Ahire. I am a beginner in this field.
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, and developers committed secrets to a public repository.
Impact
An attacker could read the source code to find further vulnerabilities and sensitive information such as credentials and tokens, and could use the exposed API key and secret.
What the attacker needed
None
The fix
The exposed .git directory was patched after reporting, and the leaked secrets should be revoked and removed from the repository.
How it was found
- Enumerate subdomains of the target and fuzz them.
- Find a subdomain that serves its .git directory.
- Use a browser extension to detect and download the .git contents.
- Also browse the .git paths manually to confirm the exposure.
- Scan GitHub repositories with a dorking tool to find committed 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.
A .git folder is the hidden bookkeeping directory that version-control software keeps next to a website's files; if a web server serves it, visitors can download the site's source code and past versions. An API key and secret are like a username and password that let a program talk to another service, so anyone who finds them can act as the site.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.