Skip to content
Info disclosure Write-up Beginner

How I Dump a Full Source Code From a Private GitHub Repo — A Freelance VAPT Story

The web application exposed its .git directory, allowing anyone to download the entire Git repository. An attacker could reconstruct the full source code and access secrets such as database credentials and cloud keys.

VETTRIVEL Follow

Published on vettrivel007.medium.com

During reconnaissance, I found that the web application was also accessible via its direct IP address (not just the domain). Accessing web apps directly via IP often reveals forgotten configurations or staging setups.

VETTRIVEL, on vettrivel007.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 web server was misconfigured to serve the .git directory from the production deployment, instead of only serving built files.

Impact

An attacker could obtain the full source code and exposed secrets, potentially leading to cloud data exfiltration and further attacks.

What the attacker needed

Web app accessible via direct IP; .git directory exposed; no authentication required

The fix

The client fixed the issue by removing .git/ from production, blocking directory access, hardening CI/CD, and rotating exposed secrets.

How it was found

  1. Access the web application via its direct IP address.
  2. Run directory fuzzing and discover the /.git/ directory.
  3. Mirror the .git/ directory to a local folder using wget.
  4. Remove placeholder index.html files from the dump.
  5. Validate and optimize the repository with git fsck, git gc, and git repack.
  6. Checkout the full source code into a working directory.

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 like a backup of all the code and its history that developers use to track changes. If a website accidentally leaves this folder accessible, anyone can download it and see the source code and any passwords or keys stored inside. This report shows how a tester found and downloaded such a folder.

What is Info disclosure?

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

More by VETTRIVEL

View all

1 more disclosed report, best first.

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.