Skip to main content
VulnerabilityPublished

GitPython: git-config OPTION-name injection via =/#/whitespace bypasses name validator, enabling forged core.sshCommand/hooksPath (RCE)

Affects GitPythonSource GCVE Database

0

CVSS 8.8 High : upgrade to 3.1.58 soon.

Data as of 8 Aug 2026, 15:41 UTC

CVSS 3.1 base score
8.8High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 3.1.58
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

What to do

Upgrade GitPython to 3.1.58.

Affected software

ProductAffectedFixed in
PyPIGitPythonAffected
  • <3.1.58
Fixed in
  • 3.1.58

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in GitPython 3.1.58 that applies the section-name safety checks to option names, rejecting unsafe characters such as '=', '#', ';', '[', ']', and whitespace. Users should upgrade to version 3.1.58 or later. Until upgraded, avoid passing untrusted input as option names to the config writer. Patch status is confirmed as fixed in 3.1.58.

Description

GitPython versions up to 3.1.57 contain a vulnerability in the config option name validation that allows injection of arbitrary git configuration directives. This occurs because the validator does not reject characters such as '=', '#', or whitespace in option names, enabling attackers to forge directives like core.sshCommand or core.hooksPath. Exploitation can lead to remote code execution on subsequent git operations. A patch is available to address this issue.

References

Community reviews

Loading reviews…