Skip to content
Info disclosure Disclosed report Beginner

Git repository found

A .git metadata directory was found in a web folder, letting an attacker request it and extract sensitive information such as configuration and file listings, including a private key and deployment files, which may help prepare further attacks.

linkks Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Triaged in under an hour
  • Fixed in 2 hours
  • Paid in 4 days
  • Disclosed after 32 days

Git metadata directory (.git) was found in this folder. An attacker can extract sensitive information by requesting the hidden metadata directory that version control tool Git creates. The metadata directories are used for development purposes to keep track of development changes to a set of source code before it is committed back to a central repository (and vice-versa). When code is rolled to a live server from a repository, it is supposed to be done as an export rather than as a local working copy, and hence this problem.

Repository files/directories: .gitignore README.md ansible/Vagrantfile ansible/development ansible/host_vars/development ansible/host_vars/production ansible/production ansible/provision.yml ansible/roles/common/files/id_rsa ansible/roles/common/tasks/main.yml

GET /wp-content/themes/.git/config HTTP/1.1 Host: 54.255.134.3:443 Connection: Keep-alive Accept-Encoding: gzip,deflate User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21 Accept: /

These files may expose sensitive information that may help an malicious user to prepare more advanced attacks.

Remove these files from production systems or restrict access to the .git directory. To deny access to all the .git folders you need to add the following lines in the appropriate context (either global config, or vhost/directory, or from .htaccess): <Directory ~ ".git"> Order allow,deny Deny from all </Directory>

The original report as published on HackerOne, by linkks. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the site was deployed as a full working copy of the Git repository rather than as a clean export, so the .git directory ended up inside the web root.

Impact

An attacker could read repository metadata and files such as a private key and deployment configuration, which may help them prepare more advanced attacks.

What the attacker needed

None

The fix

The .git directory should be removed from production systems or access to it denied at the web server level.

How it was found

  1. Request the hidden .git configuration file under the theme path on the target host.
  2. Request the hidden .git configuration file under the theme path on the target host.
  3. List the repository contents, which include deployment files and a private key.

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 report has not been written yet. The Original tab links to the source.

When developers use the Git tool to track code changes, it stores its bookkeeping in a hidden folder called .git. If that folder is uploaded to a live website by mistake, anyone can browse it and read files that were never meant to be public, such as configuration and even private keys.

What is Info disclosure?

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

More by linkks

View all

20 more disclosed reports, best first.

More from Grab

View all

The newest disclosed reports for this program.

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.