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.
Published: 2026-08-01
Score: 7.3 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Fri, 14 Aug 2026 17:15:00 +0000

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

Tue, 04 Aug 2026 00:15:00 +0000

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


Mon, 03 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Sun, 02 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython

Sat, 01 Aug 2026 12:45:00 +0000

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'}


Subscriptions

Gitpython-developers Gitpython
Gitpython Project Gitpython
Redhat Hummingbird
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-14T16:50:54.075Z

Reserved: 2026-07-29T13:07:21.184Z

Link: CVE-2026-67326

cve-icon Vulnrichment

Updated: 2026-08-03T15:32:11.033Z

cve-icon NVD

Status : Received

Published: 2026-08-01T13:17:03.063

Modified: 2026-08-05T05:17:12.440

Link: CVE-2026-67326

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-01T12:22:18Z

Links: CVE-2026-67326 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T22:15:03Z

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')