Description
GitPython before 3.1.59 omits --separate-git-dir from unsafe_git_clone_options, allowing attackers to create arbitrary git directories outside the intended clone destination. Attackers can pass a separate_git_dir parameter to Repo.clone_from() or Repo.clone() to redirect repository metadata to an attacker-controlled filesystem path, enabling arbitrary directory creation and potential hook execution.
Published: 2026-08-25
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

GitPython versions before 3.1.59 omit protection for the separate_git_dir flag when cloning repositories. When an application passes a custom path for this flag to Repo.clone_from() or Repo.clone(), the library writes repository metadata to that arbitrary location, creating directories outside the intended clone destination. This path traversal flaw can allow an attacker to write hook files or other executable code that may be triggered by the GitPython process, potentially leading to remote code execution. The weakness is a directory traversal (CWE-22) vulnerability that affects confidentiality, integrity, and availability of the hosting system if exploited.

Affected Systems

The vulnerability affects the GitPython library provided by gitpython-developers. Users running any GitPython version older than 3.1.59, especially applications that invoke clone operations with a separate_git_dir argument, are at risk. This includes scripts, CI/CD tools, or services that embed GitPython for repository interactions.

Risk and Exploitability

The CVSS score of 8.7 places the issue in the high severity range. An EPSS score is not available, but the absence of a safety check demonstrates a clear implementation oversight. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires the ability to supply a crafted separate_git_dir argument, which is most relevant to applications that allow user input for clone parameters or operate in an environment where an attacker can influence the argument list. The potential for arbitrary filesystem writes and hook execution means that, if the application runs with elevated privileges, an attacker could run arbitrary code with those rights.

Generated by OpenCVE AI on August 25, 2026 at 04:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the GitPython library to version 3.1.59 or later, which implements checks for the separate_git_dir option.
  • If an upgrade is not immediately possible, modify application code to avoid passing the separate_git_dir argument, or validate the path to ensure it resides within an expected directory.
  • Restrict the environment in which the application runs by running it in a sandboxed container or using a filesystem namespace that limits write access to the filesystem, thereby mitigating potential unauthorized directory creation.

Generated by OpenCVE AI on August 25, 2026 at 04:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8mcc-hrx5-hvxc GitPython: clone_from()/clone() omit --separate-git-dir from unsafe_git_clone_options, enabling arbitrary git-directory creation outside the destination
History

Wed, 02 Sep 2026 19:30:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*

Tue, 25 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 25 Aug 2026 02:00:00 +0000

Type Values Removed Values Added
Description GitPython before 3.1.59 omits --separate-git-dir from unsafe_git_clone_options, allowing attackers to create arbitrary git directories outside the intended clone destination. Attackers can pass a separate_git_dir parameter to Repo.clone_from() or Repo.clone() to redirect repository metadata to an attacker-controlled filesystem path, enabling arbitrary directory creation and potential hook execution.
Title GitPython before 3.1.59 Path Traversal via separate-git-dir
First Time appeared Gitpython Project
Gitpython Project gitpython
Weaknesses CWE-22
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-25T15:24:57.573Z

Reserved: 2026-08-25T01:17:12.262Z

Link: CVE-2026-78677

cve-icon Vulnrichment

Updated: 2026-08-25T15:24:54.346Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-25T02:16:52.173

Modified: 2026-09-02T19:12:24.230

Link: CVE-2026-78677

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T08:00:13Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')