Skip to content
Info disclosure Disclosed report Beginner

Insecure S3 Bucket Exposing Git Directory in Mozilla Foundation Infographics Project

An S3 bucket for the Mozilla Foundation Infographics project exposed its .git directory, allowing an attacker to dump the entire Git repository. The leaked configuration contained an old GitHub access token that was no longer valid.

psycho_012 Follow

Originally disclosed on HackerOne

  • Triaged in 2 days
  • Fixed in 5 days
  • Disclosed after 21 days

Summary by the program

Git configuration was leaked in one of the S3 buckets used by Mozilla Foundation Infographics Project. The configuration included an old Github access token which was no longer valid. We restricted access to the .git directory on the bucket.

The report

Summary

I discovered an insecure S3 bucket associated with the Mozilla Foundation's Infographics project. While the bucket itself is inaccessible, the DotGit extension alerted me that the /.git directory is accessible. I was able to use the GitDump tool to dump the entire directory.

Details

Repository Link: Mozilla Foundation Infographics

S3 Bucket: mofo-infographics.s3.amazonaws.com

Steps to Reproduce

  1. Open terminal and enter git clone https://github.com/Ebryx/GitDump.git
  2. Navigate to the GitDump directory with cd GitDump
  3. Run the GitDump tool with python3 ./git-dump.py https://mofo-infographics.s3.amazonaws.com/
  4. Navigate to the output directory with cd output/.git
  5. Observe that all files have been dumped

##POC █████████

Impact

The exposure of the /.git directory can lead to unauthorized access to sensitive information, such as source code, configuration files, and potentially secrets or credentials stored in the repository.

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

The Mozilla Foundation Infographics project publishes infographics through an S3 bucket. The project's repository links to the bucket at mofo-infographics.s3.amazonaws.com, where each project is served from a path such as projects/<launch date>-<project-name-with-hyphens>/index.html. The bucket itself is inaccessible, so browsing to its root does not reveal its contents.

Setup

The researcher used two tools:

  • The DotGit browser extension, which checks for the presence of a /.git directory on a host.
  • GitDump, cloned from https://github.com/Ebryx/GitDump.git, which reconstructs a Git repository from an exposed .git directory.

No account, role or special access was needed. The only precondition was network access to the bucket's hostname.

Finding it

While looking at the Mozilla Foundation Infographics project, the researcher found the associated S3 bucket. The bucket root was inaccessible, but the DotGit extension reported that the /.git directory was reachable. The bucket root was inaccessible, but the /.git directory was reachable.

Exploitation

Step 1: Clone GitDump

Bash
git clone https://github.com/Ebryx/GitDump.git

This fetches the tool used to reconstruct the repository.

Step 2: Enter the tool directory

Bash
cd GitDump

Step 3: Run GitDump against the bucket

Bash
python3 ./git-dump.py https://mofo-infographics.s3.amazonaws.com/

The script targets the bucket's hostname and dumps the exposed .git directory.

Step 4: Inspect the output

Bash
cd output/.git

Step 5: Confirm the dump

All files from the .git directory had been retrieved. The researcher's proof of concept is redacted in the report.

Root cause

The .git directory was deployed to the S3 bucket alongside the published site and was readable. The leaked Git configuration contained an old GitHub access token, which the program states was no longer valid.

Impact

An exposed /.git directory can give unauthorised access to sensitive information such as source code, configuration files, and potentially secrets or credentials stored in the repository. In this case the configuration held an old GitHub access token that was no longer valid, which limits the practical value of that particular secret. The program classified the issue as low severity.

Fix

The program restricted access to the .git directory on the bucket. The leaked token was already invalid.

Variants to test

  • Request /.git/config directly on static-site hosts. A positive result is a 200 response containing repository configuration.
  • Request /.git/HEAD and /.git/index. A positive result is a valid ref or index file rather than an error page.
  • Run a Git dump tool against the host and check whether objects can be reconstructed. A positive result is a complete or partial repository in the output directory.
  • Check other deployment artefacts such as .svn, .hg or backup archives next to the site root. A positive result is a directory listing or a downloadable file.

Hunting notes

This kind of bug tends to hide on static hosting and object storage where a build pipeline copies a working directory, including .git, into the web root. During recon, the useful signals are a host that serves a site but refuses bucket listing, and paths such as /.git/HEAD that return content instead of an error. The researcher dumped the entire directory with a public tool, and the program's summary confirmed the configuration held an old, invalid token.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

Mozilla Foundation runs a project called Infographics, which publishes infographics (visual explanations of information) on the web. The finished pages are stored in an Amazon S3 bucket. S3 is Amazon's file storage service: think of it as a very large shared folder on the internet, where each folder is called a bucket and each file inside it can be given its own web address.

The .git folder ended up in the bucket next to the published site. Git is the tool developers use to track changes to their code, and .git is the folder where Git keeps its records: the history of every change, the configuration, and sometimes saved credentials. That folder is never meant to be visible to visitors.

In this case the .git folder ended up in the bucket next to the published site and could be downloaded by anyone who asked for it. The researcher noticed this, used a public tool to download the whole folder, and found that the Git configuration contained an old GitHub access token. A token is a short secret string that acts like a password for a service. Mozilla later confirmed the token was no longer valid and restricted access to the .git directory. The issue was rated low severity.

The pieces involved

The bucket and the site

The Infographics repository on GitHub links to the bucket at mofo-infographics.s3.amazonaws.com. Each published project lives at a path shaped like projects/<launch date>-<project-name-with-hyphens>/index.html. The index.html file is the page a browser loads first when you visit a folder on a website.

The bucket itself is inaccessible: opening its root address does not work. That is a normal and sensible setting. But not being able to list a bucket is not the same as protecting every file in it. If you know the exact address of a file, the storage service may still hand it over.

What .git is, and why it matters

When developers work on a project, Git records snapshots of the files. All of that bookkeeping lives in a folder named .git at the top of the project. The folder contains, among other things:

  • the configuration file, which can include remote addresses and credentials;
  • the history of commits (saved snapshots);
  • an index describing the current state of the files.

If a web server serves that folder, a visitor can download the records and rebuild the source code. It is like leaving the architect's full plan, including notes about the keys, next to the finished building.

The two tools

The researcher used two tools, both freely available:

  • DotGit, a browser extension. An extension is a small add-on you install in your browser. DotGit checks whether a website exposes a /.git directory and tells you if it does.
  • GitDump, a script hosted on GitHub at https://github.com/Ebryx/GitDump.git. A script is a small program. GitDump takes an exposed .git directory and reconstructs the repository from it, file by file.

No account, login or special permission was needed. The only requirement was that the researcher's computer could reach the bucket's address over the internet.

How the researcher found it

While looking at the Mozilla Foundation Infographics project, the researcher found the associated S3 bucket. Opening the bucket root did not work, but the DotGit extension reported that the /.git directory was reachable.

The bucket root did not work, but the /.git directory was reachable.

Reproducing it, step by step

Step 1: Download GitDump

Bash
git clone https://github.com/Ebryx/GitDump.git

git clone is the Git command that copies a repository from a remote address to your computer. Here it downloads the GitDump tool itself, so the researcher has the script locally and can run it. The address after the command is the tool's public repository.

Step 2: Move into the tool's folder

Bash
cd GitDump

cd means change directory: it moves your terminal session into the folder that was just downloaded. This is needed because the next command refers to a file inside that folder.

Step 3: Run GitDump against the bucket

Bash
python3 ./git-dump.py https://mofo-infographics.s3.amazonaws.com/

python3 runs a Python program. ./git-dump.py is the script inside the GitDump folder, and the address at the end is the target: the bucket's hostname. The script asks the bucket for the files inside /.git and downloads the pieces it needs to rebuild the repository. In effect, it walks the hidden folder and collects its contents.

Step 4: Go to the downloaded records

Bash
cd output/.git

GitDump writes what it retrieves into a folder called output. This command moves into the .git folder inside that output, which is where the reconstructed repository records sit.

Step 5: Confirm the dump

All files from the .git directory had been retrieved. The researcher's proof of concept, the screenshot or recording that would normally show the result, is redacted in the report, so the exact contents are not shown there.

Why it was possible

The .git directory was in the S3 bucket alongside the published site and was readable.

The leaked Git configuration contained an old GitHub access token. Mozilla's summary states that the token was no longer valid.

What the exposure means

An exposed /.git directory can give unauthorised access to sensitive information: source code, configuration files, and potentially secrets or credentials stored in the repository. In this case the configuration held an old GitHub access token that was no longer valid, which limits the practical value of that particular secret. The program classified the issue as low severity.

The fix

Mozilla restricted access to the .git directory on the bucket. The leaked token was already invalid. Rotating a token means replacing it with a new one and invalidating the old one.

Similar things to look for

These are the same checks applied to other sites, useful when you are learning:

  • Request /.git/config directly on static-site hosts. A positive result is a 200 response containing repository configuration. A 200 response is the standard "here is your file" answer from a web server.
  • Request /.git/HEAD and /.git/index. A positive result is a valid ref or index file rather than an error page. HEAD is a small file that points to the current branch, and index describes the staged files.
  • Run a Git dump tool against the host and check whether objects can be reconstructed. A positive result is a complete or partial repository in the output directory.
  • Check other deployment artefacts such as .svn, .hg or backup archives next to the site root. A positive result is a directory listing or a downloadable file. .svn and .hg are the equivalent hidden folders for other version-control systems.

Notes for anyone hunting this

This kind of bug tends to hide on static hosting and object storage, where a build pipeline copies a working directory, including .git, into the web root. During recon (the early stage of looking around a target), the useful signals are a host that serves a site but refuses bucket listing, and paths such as /.git/HEAD that return content instead of an error.

The researcher dumped the entire directory with a public tool, and the program's summary confirmed the configuration held an old, invalid token.

Glossary

  • S3 bucket: a folder in Amazon's Simple Storage Service, used to store files that can be served over the web.
  • Git: a version-control tool that records snapshots of a project's files over time.
  • .git directory: the hidden folder where Git keeps its records, including configuration and history.
  • Repository: a project tracked by Git, including its files and history.
  • Commit: a saved snapshot of the project at a point in time.
  • Token: a secret string that acts like a password for a service or API.
  • API: a defined way for one program to talk to another, usually over the web.
  • Access control: the rules that decide who may read or change what.
  • Improper access control: a weakness where those rules are missing or too loose, so something is reachable that should not be.
  • Severity: a rating of how serious an issue is, here low.
  • Static site: a website made of ready-made files served as they are, without a database generating pages on each visit.
  • Object storage: storage that keeps files as individual objects addressed by name, rather than in a traditional folder tree.
  • Bucket listing: the ability to see every file in a bucket at once.
  • Browser extension: a small add-on installed in a browser that adds features, such as DotGit checking for /.git.
  • Script: a small program, here the Python file git-dump.py.
  • Terminal: a text window where you type commands for your computer to run.
  • git clone: the Git command that copies a remote repository to your machine.
  • cd: the command that changes which folder your terminal is working in.
  • python3: the command that runs a Python program.
  • Hostname: the name part of a web address, such as mofo-infographics.s3.amazonaws.com.
  • Path: the part of a web address after the hostname that points to a file or folder, such as /.git/config.
  • HTTP 200: the standard success response from a web server, meaning the requested file was returned.
  • HEAD: a small file in .git that points to the current branch.
  • index: a file in .git describing the currently staged files.
  • .svn and .hg: hidden folders used by other version-control systems, Subversion and Mercurial.
  • Recon: the early information-gathering stage when looking at a target.
  • Proof of concept (POC): evidence that a reported issue really works, such as a screenshot or recording.
  • Redacted: removed or hidden from the published text.
  • Token rotation: replacing a secret with a new one and invalidating the old one.
  • Build pipeline: the automated process that turns source code into the files published on a site.

More from Mozilla

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.