CVE-2026-78677
Received Received - Intake

Git Directory Hijack via GitPython Clone Options

Vulnerability report for CVE-2026-78677, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-25

Last updated on: 2026-08-25

Assigner: VulnCheck

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-25
Last Modified
2026-08-25
Generated
2026-08-25
AI Q&A
2026-08-25
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
gitpython gitpython to 3.1.59 (exc)
gitpython_developers gitpython to 3.1.59 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

GitPython before version 3.1.59 has a vulnerability where the --separate-git-dir option is not included in the unsafe_git_clone_options denylist. This allows attackers to redirect a git repository's metadata directory to an arbitrary path outside the intended clone destination by passing a separate_git_dir parameter to Repo.clone_from() or Repo.clone(). The issue arises from a mismatch between denylists in unsafe_git_init_options and unsafe_git_clone_options.

Detection Guidance

Check GitPython version with pip show GitPython. If version is 3.1.58 or earlier, the system is vulnerable. Review applications using GitPython for unsafe usage of Repo.clone_from() or Repo.clone() with separate_git_dir parameter.

Impact Analysis

This vulnerability enables attackers to create arbitrary directories outside the intended clone destination, potentially overwriting existing .git directories. In CI/build systems, this could lead to remote code execution if hooks are executed from the attacker-controlled directory. The impact includes integrity violations and unauthorized file system access.

Compliance Impact

This vulnerability could impact compliance with GDPR and HIPAA by enabling unauthorized directory creation and potential hook execution outside intended paths. For GDPR, this may risk data integrity or unauthorized access to personal data. For HIPAA, it could allow manipulation of repository metadata, potentially compromising protected health information integrity.

Mitigation Strategies

Upgrade GitPython to version 3.1.59 or later immediately. Audit code for usage of Repo.clone_from() or Repo.clone() with separate_git_dir and remove or validate the parameter. Monitor for unexpected .git directory creation outside intended paths.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-78677. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart