Skip to main content

GitPython CVE-2026-44244

HIGH
Code Injection (CWE-94)
2026-05-06 https://github.com/gitpython-developers/GitPython GHSA-v87r-6q3f-2j67
7.8
CVSS 3.1 · Vendor: https://github.com/gitpython-developers/GitPython
View

Attack ChainAIDerived

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

  1. Access
    Authenticate to application
  2. Delivery
    Inject newline payload in config parameter
  3. Exploit
    Application writes malformed .git/config
  4. Execution
    Attacker uploads malicious hook script
  5. Persist
    Victim triggers Git operation
  6. Impact
    Hook executes attacker code

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

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 application to call GitPython's config_writer().set_value() with at least one parameter derived from attacker-controlled input (user.name, user.email, or any config section/key/value). The attacker must have authenticated access to the application layer that invokes GitPython (PR:L) - in MLRun's case, valid API credentials to call project.push(). The target repository must be accessible to the attacker for writing .git/config (either direct filesystem access or via application logic that writes config on the attacker's behalf). Exploitation impact amplifies in multi-user deployments where the poisoned .git/config is shared across user contexts - non-shared single-user repositories limit impact to the repository owner's privilege level. Git operations that invoke hooks (commit, merge, checkout, rebase) must occur after poisoning for code execution to trigger, but these are standard operations in any active repository. No non-default Git configuration is required; the vulnerability works against default git 2.39+ installations. User interaction is not required (UI:N) once the config is poisoned - hooks execute automatically on qualifying Git operations.

Impact

CVSS 7.8 (High) with vector AV:L/AC:L/PR:L/UI:N indicates local attack requiring low-privileged authentication and no user interaction. However, real-world risk is significantly elevated by three factors: (1) Publicly available exploit code exists with working PoC against GitPython 3.1.46 and git 2.39+, lowering exploitation barrier to script-kiddie level. (2) The vulnerability enables persistent config poisoning - injected hooks survive across sessions and affect all users of a shared repository, turning single-user local access into multi-user impact in collaborative environments. (3) GitPython is a transitive dependency in major ML/data platforms (MLRun, DVC, MLflow, Kedro) where application code often passes user-controlled author_name/author_email to set_value() without sanitization, as demonstrated in MLRun's project.push() audit. CVSS Local vector understates risk in SaaS/shared-server deployments where 'local' means any authenticated tenant. No EPSS or KEV data provided, but the combination of public POC, widespread dependency usage, and multi-tenant privilege escalation scenarios makes this a practical priority for organizations using affected ML platforms. Patch is available (3.1.49) and straightforward to deploy. Attack complexity is genuinely low - exploitation requires only the ability to set a config value with newline injection, no race conditions or memory corruption.

Exploit ScenarioDerived

An authenticated user with access to an MLRun API endpoint calls project.push() with a crafted author_name parameter containing 'Attacker\n[core]\nhooksPath=/tmp/malicious'. MLRun passes this unsanitized value to GitPython's config_writer().set_value('user', 'name', author_name), which writes the indented continuation to .git/config. The attacker uploads a pre-commit hook script to /tmp/malicious/pre-commit containing a reverse shell payload. When any other user (including administrators) performs a commit operation on that repository - either via the same MLRun API or direct git CLI access - Git executes the attacker's hook with the victim's privileges, achieving lateral movement and potential credential theft. In single-user scenarios, automated CI/CD pipelines invoking git commit trigger the payload without human interaction.

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

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

Alert me

AnalysisAIv1 – May 06, 2026

Arbitrary code execution via Git hook redirection in GitPython 3.1.48 and earlier allows local authenticated users to inject malicious core.hooksPath configuration through newline characters in config_writer().set_value(). Publicly available exploit code exists. The vulnerability enables persistent repository poisoning where attacker-controlled hooks execute with the privileges of any user performing Git operations (commit, merge, checkout) on the poisoned repository. Particularly dangerous in multi-tenant environments like MLRun, DVC, MLflow, or Kedro where shared repositories enable privilege escalation across user contexts. Fixed in GitPython 3.1.49.

RemediationAI

Upgrade GitPython to version 3.1.49 or later, which implements input validation rejecting CR, LF, and NUL characters in config values (https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-v87r-6q3f-2j67). For applications unable to upgrade immediately, implement input validation at call sites: wrap all config_writer().set_value() calls with a check that raises ValueError if the value parameter contains newline or null bytes using regex pattern r'[\r\n\x00]'. Do not strip/replace characters - rejection is safer than normalization because silent stripping masks upstream injection attempts and may break legitimate use cases expecting validation errors. In multi-tenant environments (MLRun servers, shared Jupyter/ML platforms), audit all code paths passing user-supplied data to GitPython config operations, prioritizing author_name, author_email, commit messages, and branch names. As a defense-in-depth measure, run Git operations with core.hooksPath set to a read-only trusted directory via environment variable GIT_CONFIG_COUNT/GIT_CONFIG_KEY/GIT_CONFIG_VALUE, though this does not prevent config file poisoning and may break legitimate hook workflows. Review .git/config files in shared repositories for unexpected [core] sections or hooksPath directives as an incident response step.

Affected Packages

pypi gitpython fix: 3.1.49

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 object model access to Git repositories, widely used by ML/data platforms (DVC, MLflow, Kedro, MLRun). The vulnerability (CWE-94: Improper Control of Generation of Code) exists in GitConfigParser.set_value(), which writes user-supplied values to .git/config via Python's configparser module. GitPython converts embedded newlines to indented continuation lines (\n becomes \n\t), but Git's config parser treats indented [section] headers as valid section starts. An attacker injects '\n[core]\nhooksPath=/attacker/path' into config values (e.g., user.name or user.email), which GitPython writes as indented lines but Git interprets as a core.hooksPath directive. The affected package per CPE is pkg:pip/gitpython versions ≤3.1.48. The root cause is missing input validation for control characters (CR/LF/NUL) before passing values to the configuration writer, creating a config injection vector that Git's lenient parser converts into executable directives.

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
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH
Red Hat 7.3 HIGH

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

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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

GitConfigParser.set_value() passes values to Python's configparser without validating for newlines. GitPython's own _write() converts embedded newlines into indented continuation lines (e.g. \n becomes \n\t), but Git still accepts an indented [core] stanza as a section header - so the injected core.hooksPath becomes effective configuration. Any Git operation that invokes hooks (commit, merge, checkout) will then execute scripts from the attacker-controlled path.

The vulnerability is not merely malformed config output: GitPython's own writer converts embedded newlines into indented continuation lines, but Git still accepts an indented [core] stanza as a section header, so the injected core.hooksPath becomes effective configuration.

This was found while auditing MLRun's project.push() method, which passes author_name and author_email directly to config_writer().set_value() with no sanitization. Both parameters cross a trust boundary - they are caller-supplied API inputs that end up in .git/config.

PoC (standalone, no MLRun required):

python
import git, subprocess, os

repo = git.Repo("/tmp/testrepo")

with repo.config_writer() as cw:
    cw.set_value("user", "name", "foo\n[core]\nhooksPath=/tmp/hooks")

r = subprocess.run(["git", "config", "core.hooksPath"], cwd="/tmp/testrepo", capture_output=True, text=True)
assert r.returncode == 0
print(r.stdout.strip())
# /tmp/hooks

os.makedirs("/tmp/hooks", exist_ok=True)
open("/tmp/hooks/pre-commit", "w").write("#!/bin/sh\nid > /tmp/pwned\n")
os.chmod("/tmp/hooks/pre-commit", 0o755)

repo.index.add(["README"])
repo.git.commit(m="test")
print(open("/tmp/pwned").read())
# uid=...

Tested on GitPython 3.1.46, git 2.39+.

Impact: This is persistent repo config poisoning. Any user who can supply author_name or author_email to an application calling config_writer().set_value() can redirect Git hook execution to an arbitrary path. In a multi-user or hosted environment (e.g. a shared MLRun server where multiple users push to the same repositories), one user can poison the .git/config of a shared repo and have their hooks run in the context of every subsequent Git operation by any user. On single-user deployments, the impact depends on whether the application later invokes Git hooks automatically.

Remediation: set_value() should raise on CR, LF, or NUL in values rather than silently pass them through:

python
import re

if isinstance(value, (str, bytes)) and re.search(r"[\r\n\x00]", str(value)):
    raise ValueError("Git config values must not contain CR, LF, or NUL")

Rejecting is safer than stripping - a stripped newline might indicate the caller is passing unsanitized input at a higher level, and silent normalization masks that.

Affected wherever config_writer().set_value(section, key, user_input) is called with external input.** GitPython is a dependency of DVC, MLflow, Kedro, and others - worth auditing their set_value() call sites for externally influenced inputs.

Executive ViewAI

Why It Matters

GitPython versions 3.1.48 and earlier contain a critical code execution vulnerability that allows authenticated local attackers to inject malicious Git hooks, potentially compromising any user who performs Git operations on affected repositories. Organizations using GitPython in multi-tenant ML/data pipeline environments (MLRun, DVC, MLflow, Kedro) face elevated risk of privilege escalation and persistent repository compromise affecting shared infrastructure.

Business Impact: High
Compensating Controls

Vendor-released patch: GitPython 3.1.49. Until patching is complete: restrict local shell access to systems running vulnerable GitPython versions; implement strict file permissions (read-only) on .git/config in shared repositories; disable local Git hook execution where operationally feasible; enhance monitoring and alerting for unexpected processes spawned during Git operations; segregate multi-tenant repositories using containerization or separate file systems.

Threat Intelligence Overview

EPSS Score
0.0%
Top 94% 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.0%
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
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
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

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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