Cloudanix VulnDB

CVE-2026-78677

High · 7.5

CVSS

7.5

EPSS

0.7%

Published

Aug 25, 2026

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A bug in a common Python tool for working with code repositories lets attackers create folders in places they should not be able to, which could let them run harmful code on the affected system.

Exploit Available
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Data Tampering
Component
Library
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw permits bypassing of unsafe_git_clone_options restrictions by omitting --separate-git-dir, allowing the separate_git_dir parameter passed to Repo.clone_from() or Repo.clone() to redirect repository metadata creation to arbitrary attacker-controlled filesystem paths outside the intended destination, enabling directory traversal and potential subsequent hook execution.

Why it matters to the business

Organizations relying on GitPython for automated repository operations face risk of unauthorized directory creation across their filesystem, which can facilitate data exfiltration, persistence via hooks, or execution of attacker-supplied code, leading to operational disruption and incident response costs.

How an attack unfolds

An attacker identifies an application using vulnerable GitPython, supplies a malicious separate_git_dir parameter pointing outside the clone target during a call to Repo.clone_from() or Repo.clone(), and triggers the clone operation to force creation of arbitrary directories and potential execution of hooks at the attacker-chosen path.

How to fix it

Upgrade GitPython to version 3.1.59 or later. Sanitize or restrict all parameters passed to clone methods and avoid accepting untrusted values for git options.

How to confirm the fix worked

Verify installed GitPython version is at least 3.1.59; audit source code and dependencies for direct calls to Repo.clone_from() or Repo.clone() accepting untrusted input; test clone operations with attempted separate_git_dir parameters to confirm rejection.

Typical attack path

  1. Locate application code or API endpoints invoking vulnerable GitPython clone methods
  2. Craft input supplying a separate_git_dir parameter targeting an attacker-chosen path
  3. Trigger the clone operation from an untrusted source
  4. Observe creation of arbitrary directories and any resulting hook execution

How to detect it

Search application and dependency logs for invocations of Repo.clone or clone_from containing separate_git_dir; monitor filesystem events for unexpected .git directories created outside normal clone destinations; inspect git hook scripts appearing in non-standard locations.

  • separate_git_dir
  • Repo.clone_from
  • Repo.clone
  • .git/hooks

What your security team should do

  • Immediately upgrade all instances of GitPython to 3.1.59 or newer
  • Implement strict input validation and whitelisting on any clone-related parameters
  • Review application logs and filesystem activity for unexpected .git directory creation
  • Add runtime monitoring for git hook execution outside expected repository paths

The record

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.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities