CVE-2026-67326

GitPython before 3.1.50 Newline Injection via config_writer section

Published Aug 1, 2026 CVSS 4.0 · 7.3 High EPSS < 1% KEV · Not listed
Description
GitPython before 3.1.50 fails to validate newline characters in the section parameter of config_writer(), allowing attackers to inject arbitrary section headers into .git/config. Attackers can inject newlines to create a forged [core] section with hooksPath pointing to attacker-controlled directories, achieving remote code execution when git hooks are triggered.

Analysis

AI-generated

Technical impact

The vulnerability is a newline injection in GitPython’s config_writer() function. The library does not sanitize the section parameter, allowing attackers to embed newline characters. By inserting newlines, a malicious user can forge a new section header in the repository’s .git/config file, such as a core section whose hooksPath points to an attacker‑controlled directory. When Git subsequently executes hooks from that directory, it runs attacker‑supplied scripts, giving remote code execution.

Affected Systems

All installations of GitPython version 3.1.49 and earlier. The affected product is the open‑source GitPython library maintained by the gitpython‑developers on the Python Package Index, commonly used in Python applications that interact with Git repositories.

Risk and Exploitability

The CVSS score of 7.3 indicates high severity. The EPSS score of 0.00191 (about 0.19%) shows a very low but non‑zero probability of exploitation, which aligns with the not‑listed-in KEV status. The vulnerability is remote‑code‑execution‑capable after a forged hooksPath is set, and attack requires the ability to call config_writer() with a malicious section string, which typically requires execution or the ability to inject crafted data into a related Python application.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade GitPython to version 3.1.50 or later
  • If an upgrade is not immediately possible, validate or strip newline characters from any string passed to config_writer() before use
  • If the section value is constructed by a third‑party library, add input validation or escape the value to remove newlines
  • As a temporary mitigative measure, disable execution of Git hooks by setting core.hooksPath to a secure directory or removing the hooksPath entry from the repository’s configuration

Generated by OpenCVE AI on August 4, 2026 at 22:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
History
Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
Weaknesses CWE-93
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython
Type Values Removed Values Added
Description GitPython before 3.1.50 fails to validate newline characters in the section parameter of config_writer(), allowing attackers to inject arbitrary section headers into .git/config. Attackers can inject newlines to create a forged [core] section with hooksPath pointing to attacker-controlled directories, achieving remote code execution when git hooks are triggered.
Title GitPython before 3.1.50 Newline Injection via config_writer section
Weaknesses CWE-20
References
Metrics cvssV3_1

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

cvssV4_0

{'score': 7.3, 'vector': 'CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Aug 14, 2026, 4:50 PM
Reserved
Jul 29, 2026, 1:07 PM
Status
Analyzed
Published
Aug 1, 2026, 1:17 PM
Modified
Oct 23, 2026, 11:10 PM
Severity
Moderate
Public date
Aug 1, 2026, 12:22 PM