Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker submits crafted option name via application
-
DeliveryApplication passes name to config_writer.set_value()
-
Exploit_assure_config_name_safe() bypassed for = and # chars
-
Executionwrite_section emits forged directive to git config file
-
Persistcore.sshCommand parsed by git as valid directive
-
ImpactNext SSH git operation executes attacker command
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Input neutralization, injection prevention
|
| Exploitation Conditions | Exploitation requires that the embedding application forwards a caller-influenced value as the option-name argument (second positional parameter) to |
| Impact | The vendor-provided CVSS 4.0 score of 8.7 uses AC:L and AT:N, reflecting the assessment that once user-controlled input reaches the config writer, exploitation is trivial and low-complexity. However, a structurally important prerequisite exists: the embedding application must expose attacker-influenced data as the option-name parameter to |
| Exploit ScenarioDerived | An attacker with a low-privilege account on a CI/CD platform or Git hosting service submits a repository configuration request containing an option name such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Config-name injection in GitPython <= 3.1.57 enables arbitrary git-config directive forgery and remote code execution via core.sshCommand or core.hooksPath. The option-name validator in git/config.py only blocks CR/LF/NUL, allowing =, #, and whitespace to pass unchecked; write_section then writes the option name verbatim, causing git to parse attacker-supplied content as a valid directive. Exploitation requires a calling application to forward attacker-influenced input to config_writer.set_value() as the option-name argument, and a proof-of-concept is publicly confirmed in the vendor GHSA advisory. No CISA KEV listing is present at time of analysis.
RemediationAI
Upgrade GitPython to version 3.1.58 or later via pip: pip install 'GitPython>=3.1.58'. The patch is available in PR https://github.com/gitpython-developers/GitPython/pull/2204 and committed at https://github.com/gitpython-developers/GitPython/commit/a495ccd3b547ccd60b2187215823b72a9c0188bf. As an immediate compensating control before patching, applications should apply an allowlist of known-safe option names before passing them to config_writer.set_value(), rejecting any name containing =, #, ;, [, ], or whitespace; a blocklist approach is not recommended because the character class may be incomplete. Alternatively, eliminating the code path where caller-influenced data is used as the option-name argument entirely removes the attack surface. Note that patches applied for prior GitPython advisories GHSA-3rp5-jjmw-4wv2 or GHSA-mv93-w799-cj2w do not remediate this vulnerability - version 3.1.58 is required.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GitPython is a widely-used Python library for programmatic Git repository interaction (CPE: cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*). The root cause (CWE-74: Injection) is an incomplete input validation boundary in _assure_config_name_safe() at git/config.py:897: the function applies a bracket/quote state machine only when label == 'section', while option-label validation falls through to only check UNSAFE_CONFIG_CHARS_RE = [\r\n\x00]. This leaves =, #, ;, [, ], and whitespace entirely unguarded for option names. The write_section method at config.py:702 then emits the raw option name into the template '\t%s = %s\n', so a name like sshCommand = touch /tmp/RCE # becomes `\tsshCommand = touch /tmp/RCE
= x\n in the on-disk config - which git parses as core.sshCommand = touch /tmp/RCE because the trailing #` comments out the remainder. This is architecturally distinct from prior GitPython injection advisories GHSA-3rp5-jjmw-4wv2 (section-name bracket injection) and GHSA-mv93-w799-cj2w/GHSA-v87r-6q3f-2j67 (newline injection); those patches do not cover this character class or field.
Know when Gitpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
AC:H because the application must forward user-controlled input as the option-name argument; PR:L as a low-privilege application account suffices; S:C because git executes commands outside GitPython's process scope.
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
GitPython before 3.1.58 contains a config-name injection vulnerability in the option-name validator that allows attackers to forge arbitrary git-config directives by injecting equals signs, hash symbols, and whitespace into option names. Attackers can inject malicious option names like 'sshCommand = touch /tmp/RCE #' to execute arbitrary commands via core.sshCommand or core.hooksPath on the next git operation.
Blast Radius
ecosystem impact- 16 pypi packages depend on gitpython (15 direct, 1 indirect)
Ecosystem-wide dependent count for version 3.1.58.
Executive ViewAI
GitPython library versions 3.1.57 and earlier enable remote code execution through configuration injection, with publicly available exploit code confirmed in vendor advisories. Any development team or CI/CD system using vulnerable GitPython versions that accept external input faces critical risk of malicious code execution within repository operations. Immediate action is required to identify exposure and implement interim controls, particularly for systems managing production deployments or sensitive intellectual property.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation rejecting special characters (=, #, whitespace) in config option names passed to GitPython; (2) Apply least-privilege service accounts for all GitPython-dependent processes; (3) Enable audit logging on git configuration changes and git hook execution; (4) Restrict or disable git hook execution on affected systems; (5) Network-isolate systems handling production or sensitive repositories until patch availability.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w
Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config
Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th
GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont
GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability
Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s
Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a
GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili
GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS
Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti
Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl
Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und
Same technique Code Injection
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-62462
GHSA-78pq-g4m8-fx2c
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB