Skip to content
Info disclosure Write-up Beginner

The Hidden .git

An exposed .git directory was publicly accessible on a CloudFront distribution for a chatbot subdomain. An attacker could access the .git/config file, potentially revealing sensitive information, though no credentials were found.

medium.com

Published on medium.com

Hey folks! I hope you’re enjoying my bug hunting stories as much as I enjoy writing them.

SIDDHANT SHUKLA, on medium.com

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 .git directory was accidentally deployed to the production web root and served by the CloudFront distribution.

Impact

The exposed .git directory could allow an attacker to access source code and configuration files, but no sensitive credentials were found in this case.

What the attacker needed

Publicly accessible CloudFront distribution; No authentication required

The fix

The exposed .git directory was silently fixed shortly after the report.

How it was found

  1. Enumerate subdomains of the target domain using subfinder and httpx.
  2. Identify a chatbot subdomain and perform directory enumeration with dirsearch.
  3. Use ffuf to find additional subdomains like chatbot-v2.
  4. Resolve both chatbot subdomains to CloudFront addresses using dig.
  5. Run dirsearch against the CloudFront URL of chatbot-v2.
  6. Access the exposed .git/config file via the CloudFront URL.

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 uses to store the history of a website's code. If it is left publicly accessible, anyone can download it and see the source code, which might include secrets. Here, the folder was exposed on a content delivery network, but the specific file found did not contain passwords.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.