CVE-2026-78677
High · 7.5CVSS
7.5
EPSS
0.7%
Published
Aug 25, 2026
CISA due date
—
Cloudanix analysis
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.
- 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
- Locate application code or API endpoints invoking vulnerable GitPython clone methods
- Craft input supplying a separate_git_dir parameter targeting an attacker-chosen path
- Trigger the clone operation from an untrusted source
- 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
- CVE-2026-108327 Tanium addressed a path traversal vulnerability in Tanium Data Service. CWE-22
- CVE-2026-121542 In Docker Buildx versions v0.19.0 through v0.38.0, an untrusted Bake definition may… CWE-22
- CVE-2026-63502 Yeti bridges the gap between CTI and DFIR practitioners by providing a Forensics… CWE-22
- CVE-2026-63478 isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. CWE-22
- CVE-2026-63500 Yeti bridges the gap between CTI and DFIR practitioners by providing a Forensics… CWE-22
- CVE-2026-63395 isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. CWE-22
- CVE-2026-63436 zt-zip is a Java library that provides convenience methods for ZIP archive manipulation. CWE-22
- CVE-2026-121263 A vulnerability was determined in phpMyAdmin MoTranslator up to 6.0.1. CWE-22