Weakness · Medium

CWE-527: Exposure of Version-Control Repository to an Unauthorized Control Sphere

What it is

The product stores a CVS, git, or other repository in a directory, archive, or other resource that is stored, transferred, or otherwise made accessible to unauthorized actors.

MITRE CWE 4.19.1

Severity (our rating)
Medium
Likelihood of exploit
Not rated by MITRE
Introduced during
Operation
Exploited in the wild
No CVE in CISA's catalog

In more detail

Version control repositories such as CVS or git store version-specific metadata and other details within subdirectories. If these subdirectories are stored on a web server or added to an archive, then these could be used by an attacker. This information may include usernames, filenames, path root, IP addresses, and detailed "diff" data about how files have been changed - which could reveal source code snippets that were never intended to be made public.

What an attacker can do

  • Read Application Data (Confidentiality)
  • Read Files or Directories (Confidentiality)

How to prevent it

Operation

  • Recommendations include removing any CVS directories and repositories from the production server, disabling the use of remote CVS repositories, and ensuring that the latest CVS patches and version updates have been performed.

While the code is being fixed, a WAF in blocking mode stops requests for exposed .git directories at the edge.

CWE-527 on MITRE's CWE site

The Dome

Block it at the edge while you fix it

The Dome's WAF runs the OWASP Core Rule Set in blocking mode and stops requests for exposed .git directories before they reach your application.

See the Dome

T Academy

Stop writing it in the first place

Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.

Start free

Source: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.