Skip to content
Info disclosure Write-up Beginner

Looking for gaps in GIT information

The web application exposed its .git version control directory, allowing anyone to download the repository history. An attacker could walk the commit history to recover a plaintext administrator password and then log in to delete another user's account.

medium.com

Published on medium.com

Here I will share my experience solving the lab in portswigger entitled “Lab: Information disclosure in version control history”. Here the command is to know Administrator password and delete Carlos’ account.

Luthfi Sulthany, 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

Impact

An attacker could obtain the administrator password and use it to log in and delete another user's account.

What the attacker needed

Exposed .git directory; network access to the site

How it was found

  1. Append /.git to the site URL to reach the exposed repository.
  2. Download the repository recursively with wget.
  3. List the directory contents and run git log to see the commits.
  4. Use git cat-file on the first commit to read its contents.
  5. Repeat the command on each parent commit until the password appears.
  6. Log in as administrator and delete the target account.

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.

Many websites keep their source code in a hidden folder called .git, which records every past change. If the server forgets to block that folder, anyone can download it and read old versions of files, including secrets that were later removed. Here an old commit still contained the admin password in plain text.

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.