CVE-2026-78677

Description

A flaw was found in GitPython. This vulnerability allows a remote attacker to create arbitrary Git directories outside the intended clone destination. By manipulating the separate_git_dir parameter during repository cloning, an attacker can redirect repository metadata to an attacker-controlled filesystem path. This could lead to arbitrary directory creation and potentially enable the execution of malicious code through Git hooks.

Statement

Red Hat Product Security has identified a path traversal vulnerability in GitPython versions before 3.1.59. The vulnerability arises because the --separate-git-dir option is not included in the unsafe_git_clone_options denylist, allowing attackers who control the separate_git_dir parameter during repository cloning to redirect Git repository metadata to arbitrary filesystem locations outside the intended clone destination. This can lead to arbitrary directory and file creation bounded only by process permissions. When combined with subsequent Git operations that trigger hook execution on the redirected repository, this vulnerability can escalate to arbitrary code execution. Exploitation requires that the application passes untrusted, attacker-controlled input to the separate_git_dir keyword argument of Repo.clone_from() or Repo.clone() methods without proper validation, while the allow_unsafe_options parameter remains at its default value of False.

Mitigation

To mitigate this vulnerability, upgrade to GitPython version 3.1.59 or later, which correctly includes `--separate-git-dir` in the unsafe options denylist. If upgrading is not immediately possible, ensure that the `separate_git_dir` parameter is never populated from untrusted or user-controlled sources. Applications should validate and sanitize any input before passing it to GitPython cloning methods, or avoid exposing the `separate_git_dir` parameter to external callers entirely.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7.5N/A7.5
Attack VectorNetworkN/ANetwork
Attack ComplexityLowN/ALow
Privileges RequiredNoneN/ANone
User InteractionNoneN/ANone
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactNoneN/ANone
Availability ImpactNoneN/ANone

Vector

Red Hat: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Understanding the Weakness (CWE)

Integrity,Confidentiality,Availability

Technical Impact: Execute Unauthorized Code or Commands

The attacker may be able to create or overwrite critical files that are used to execute code, such as programs or libraries.

Integrity

Technical Impact: Modify Files or Directories

The attacker may be able to overwrite or create critical files, such as programs, libraries, or important data. If the targeted file is used for a security mechanism, then the attacker may be able to bypass that mechanism. For example, appending a new account at the end of a password file may allow an attacker to bypass authentication.

Confidentiality

Technical Impact: Read Files or Directories

The attacker may be able to read the contents of unexpected files and expose sensitive data. If the targeted file is used for a security mechanism, then the attacker may be able to bypass that mechanism. For example, by reading a password file, the attacker could conduct brute force password guessing attacks in order to break into an account on the system.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

The attacker may be able to overwrite, delete, or corrupt unexpected critical files such as programs, libraries, or important data. This may prevent the product from working at all and in the case of protection mechanisms such as authentication, it has the potential to lock out product users.

Frequently Asked Questions

Want to get errata notifications? Sign up here.