CVE-2026-44244: GitPython newline injection in GitConfigParser.set_value

CVE-2026-44244 · Severity: high · CVSS 7.8 · Published 2026-05-07

GitPython is a popular Python library used by developers and automation tools to interact with Git repositories. A security flaw allows an attacker to inject malicious configuration settings into a repository's setup file if the application using the library doesn't properly check user-provided information like names or emails. This could allow an attacker to gain full control over the system by forcing Git to run unauthorized scripts whenever common actions like committing or merging code occur.

Technologies: Gitpython Project Gitpython, gitpython (PyPI). Vendors: Gitpython Project, PyPI.

Quick answers

Is CVE-2026-44244 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-44244 being exploited in the wild.
How severe is CVE-2026-44244?
High severity, with a CVSS score of 7.8, published 7 May 2026.
Which products and versions are affected?
gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.49.
Is there a fix for CVE-2026-44244?
Yes. gitpython (PyPI): upgrade to 3.1.49 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-44244 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-44244?
Check whether you run Gitpython Project Gitpython or gitpython (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gitpython (PyPI): upgrade to 3.1.49 or later
    pip install "gitpython>=3.1.49"

Technical details

A newline injection vulnerability exists in GitPython's GitConfigParser.set_value() method. The root cause is a failure to validate or sanitize input for newline characters before passing them to the underlying configuration writer. While GitPython attempts to indent newlines into continuation lines, Git's configuration parser still recognizes these indented stanzas as valid section headers. An attacker with the ability to provide input to set_value() (such as through unsanitized author names or emails in a web application) can inject a '[core]' section with a 'hooksPath' directive. This redirects Git hooks to an attacker-controlled directory, leading to arbitrary code execution whenever a Git operation (e.g., commit, merge, checkout) is performed. The issue is fixed in version 3.1.49 by rejecting control characters in configuration values.

Affected products

  • gitpython-developers GitPython <= 3.1.48

Identifiers

  • CVE-2026-44244
  • GHSA-v87r-6q3f-2j67
  • PYSEC-2026-2163

Timeline

  • 2026-04-29: advisory: GitHub Security Advisory published
  • 2026-04-30: patched: Version 3.1.49 released
  • 2026-05-07: disclosed: CVE-2026-44244 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.