CVE-2026-78677: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in gitpython-developers GitPython
Description
CVE-2026-78677 is a path traversal vulnerability in GitPython's clone functionality, specifically in the handling of the --separate-git-dir option. The vulnerability arises because the denylist for unsafe clone options does not include --separate-git-dir, allowing an attacker to redirect the repository's .git metadata directory to an arbitrary filesystem path. This can lead to arbitrary directory and file creation outside the intended clone destination, limited only by the filesystem permissions of the process running GitPython.
CVSS v4.0
Score 8.7high
Affected software
gitpython-developers
GitPython
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
GitPython versions prior to 3.1.59 have an improper limitation of pathname to a restricted directory vulnerability (CWE-22, CWE-73) in the Repo.clone_from() and Repo.clone() methods. These methods forward keyword arguments to the underlying git clone command but rely on a denylist (Repo.unsafe_git_clone_options) to block unsafe options. However, this denylist omits the --separate-git-dir option, which allows redirection of the .git metadata directory to an arbitrary path. As a result, an attacker controlling input to separate_git_dir can cause git clone to create repository metadata outside the intended directory, potentially planting malicious files or hooks. This issue is due to a parity gap between denylist entries for git init and git clone commands. The vulnerability has a CVSS 4.0 score of 8.7 (high severity).
Potential Impact
An attacker able to supply the separate_git_dir argument to Repo.clone_from() or Repo.clone() can cause GitPython to execute git clone with the --separate-git-dir option pointing to an arbitrary filesystem path. This leads to creation of the full git repository metadata structure, including hooks, at a location outside the intended clone destination. The impact is arbitrary directory and file creation controlled by the attacker, bounded only by the permissions of the process running GitPython. This can facilitate malicious repository manipulation or code execution via planted hooks or files.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing the separate_git_dir or separate-git-dir option to Repo.clone_from() or Repo.clone(), or ensure that allow_unsafe_options is not set to True and that input is strictly validated to prevent injection of unsafe options. Monitor vendor advisories for updates addressing the omission of --separate-git-dir from the unsafe_git_clone_options denylist.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-25T01:17:12.262Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8cf57dacd9273b498428de
Added to database: 08/25/2026, 01:53:01 UTC
Last enriched: 09/18/2026, 01:53:01 UTC
Last updated: 10/07/2026, 18:48:23 UTC
Views: 108
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.