CVE-2026-44244

GitPython: Newline injection in config_writer().set_value() enables RCE via core.hooksPath

Published May 7, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
Description
GitPython is a python library used to interact with Git repositories. Prior to version 3.1.49, 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. This issue has been patched in version 3.1.49.

Analysis

AI-generated

Technical impact

GitPython, a Python library for Git interactions, allows an attacker to inject newlines into configuration values via the set_value() function. The injected newlines are not properly validated by Python's configparser, leading to an unintended core.hooksPath entry. When Git executes hooks during operations such as commit or merge, scripts located at the attacker‑controlled path are run, giving full code‑execution capability. The weakness is a code‑injection flaw classified as CWE‑94 and carries a CVSS score of 7.8.

Affected Systems

Any installation of GitPython earlier than version 3.1.49, distributed by the GitPython developers, is affected. The vulnerability is tied to the library’s configuration handling and applies to all environments that use GitPython to perform Git operations.

Risk and Exploitability

With a high CVSS score of 7.8, the vulnerability represents a serious threat. No EPSS value is available, making it unclear how frequently this is exploited, but the fact that the flaw leads to RCE means even a low exploitation probability can be unacceptable. The attack is most likely delivered by an attacker who has write access to a repository's configuration or can influence the creation of a GitPython‑based script. No conditional prerequisites beyond the use of GitPython are stated, and the flaw is not listed in the CISA KEV catalog at present.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade GitPython to version 3.1.49 or later, which validates configuration values and removes the injection vector
  • Ensure that any user‑controlled or downloaded scripts are stored outside the core.hooksPath directory or that hooks execution is disabled in your environment
  • Review and restrict the permissions of directories used by GitPython when performing Git operations to limit the impact of any remaining configuration changes

Generated by OpenCVE AI on May 7, 2026 at 20:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
Github GHSA Github GHSA GHSA-v87r-6q3f-2j67 GitPython: Newline injection in config_writer().set_value() enables RCE via core.hooksPath
Ubuntu USN Ubuntu USN USN-8303-1 GitPython vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
Vendors & Products Gitpython Project
Gitpython Project gitpython
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description GitPython is a python library used to interact with Git repositories. Prior to version 3.1.49, 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. This issue has been patched in version 3.1.49.
Title GitPython: Newline injection in config_writer().set_value() enables RCE via core.hooksPath
Weaknesses CWE-94
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 9, 2026, 3:56 AM
Reserved
May 5, 2026, 4:33 PM
Status
Analyzed
Published
May 7, 2026, 7:16 PM
Modified
Nov 11, 2026, 11:10 PM