Skip to main content

GitPython CVE-2026-42284

| EUVDEUVD-2026-28412 HIGH
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (CWE-88)
2026-05-07 GitHub_M GHSA-x2qx-6953-8485
8.1
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Recon
    Identify target with user-controlled clone options
  2. Delivery
    Send crafted multi_options with embedded --config
  3. Exploit
    GitPython validates pre-split string
  4. Install
    shlex.split creates separate --config token
  5. C2
    Git applies malicious core.hooksPath config
  6. Execute
    Git executes attacker hooks during clone
  7. Impact
    Arbitrary code execution in application context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Argument sanitization
Exploitation Conditions

Exploitation requires the target application to call GitPython's Repo.clone_from() or Submodule.update() methods with the multi_options or clone_multi_options parameter derived from attacker-controlled input. This typically occurs in repository management platforms, CI/CD systems, documentation generators, or Git hosting services that allow users to specify custom clone options or repository configurations. The vulnerability is NOT exploitable against applications that hardcode multi_options or sanitize input to reject strings containing whitespace or special characters. Network access (AV:N) means the attacker can trigger the vulnerability remotely via HTTP API, web form, or service interface without local system access. High attack complexity (AC:H) reflects the requirement to control specific function parameters - not all GitPython usage is vulnerable, only code paths that accept external multi_options. No authentication (PR:N) or user interaction (UI:N) is required once the vulnerable code path is reached, making automated exploitation feasible against exposed endpoints. The attack succeeds on default GitPython configurations without requiring non-standard features or settings.

Impact

Real-world risk is moderate-to-high for applications that pass untrusted input to GitPython's clone operations. CVSS 8.1 (AV:N/AC:H/PR:N/UI:N) indicates network-exploitable without authentication but with high attack complexity - the attacker must control multi_options arguments passed to Repo.clone_from() or Submodule.update(), which typically requires the application to accept user-supplied repository URLs or clone options. Public exploit code exists (GitHub advisory GHSA-x2qx-6953-8485 includes working PoC), lowering the barrier for exploitation. However, EPSS score and KEV status are not available at time of analysis, suggesting no confirmed widespread or automated exploitation campaigns. The scope is unchanged (S:U), meaning impact is limited to the GitPython process context, but full confidentiality/integrity/availability compromise is possible via arbitrary code execution through malicious hooks. Priority depends on whether your application exposes multi_options to external input - most defensive uses of GitPython with hardcoded clone parameters are not vulnerable. Organizations using GitPython in web APIs, CI/CD pipelines, or repository management platforms with user-supplied clone options should prioritize remediation immediately.

Exploit ScenarioDerived

An attacker identifies a web application that clones Git repositories based on user-supplied URLs and clone options (e.g., a CI/CD platform, documentation builder, or code review tool). The attacker crafts a malicious multi_options parameter: ['--branch main --config core.hooksPath=/tmp/evil']. The application passes this to GitPython's Repo.clone_from(), which validates the string as starting with '--branch' and allows it. After shlex.split, Git receives '--config core.hooksPath=/tmp/evil' as a separate argument, configures the hooks path, and executes the attacker's post-checkout hook during clone, achieving remote code execution in the application server context with full access to confidential data, integrity modification capabilities, and potential lateral movement to infrastructure.

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

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

Alert me

AnalysisAIv1 – May 07, 2026

Remote code execution in GitPython < 3.1.47 allows unauthenticated network attackers to inject malicious Git configuration during repository clone operations via crafted multi_options arguments. The _clone() method validates options before shlex.split transformation, enabling attackers to bypass unsafe option checks by embedding commands like '--config core.hooksPath=/attacker/path' within '--branch' strings. Git then executes attacker-controlled hooks during clone. Vendor-released patch available in version 3.1.47. CVSS 8.1 with high attack complexity; no EPSS or KEV data available, but public exploit code exists per GitHub security advisory GHSA-x2qx-6953-8485.

RemediationAI

Upgrade GitPython to version 3.1.47 or later immediately (pip install --upgrade GitPython==3.1.47). This version fixes the validation logic to check options after shlex.split transformation. Release notes confirm the patch at https://github.com/gitpython-developers/GitPython/releases/tag/3.1.47. If immediate upgrade is not possible, implement strict input validation to reject any multi_options strings containing whitespace or shell metacharacters - however, this workaround is complex due to legitimate use cases for quoted arguments, so upgrading is strongly preferred. Do not accept multi_options or clone_multi_options values from untrusted sources; if repository clone configuration must be user-configurable, use an allowlist of specific options (e.g., only permit '--branch <value>' with value validated against a known branch list). Note that blocking --config alone is insufficient due to other potentially dangerous options like --upload-pack. For defense-in-depth, run GitPython operations in sandboxed environments with no write access to system directories and with disabled hooks execution via Git's core.hooksPath set to /dev/null, though this mitigation may break legitimate hook-dependent workflows.

Affected VersionsENISA

GitPython < 3.1.47

Affected Packages

pypi gitpython fix: 3.1.47

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 Python library for programmatic interaction with Git repositories (cpe:2.3:a:gitpython-developers:gitpython). The vulnerability stems from CWE-88 (Improper Neutralization of Argument Delimiters) in the _clone() function at git/repo/base.py. The code path performs security validation on the original multi_options list, then transforms it via shlex.split(" ".join(multi_options)), and finally passes the transformed result to git clone. The validation uses startswith() checks against unsafe_git_clone_options, which cannot detect dangerous options embedded within quoted strings. For example, '--branch main --config core.hooksPath=/x' passes validation as a single string starting with '--branch', but shlex.split converts it to separate tokens ['--branch', 'main', '--config', 'core.hooksPath=/x'], allowing the --config directive to reach Git's command line. Git then applies the configuration and executes hooks from the attacker-controlled path during clone operations. The same logic flaw affects Submodule.update() via clone_multi_options parameter.

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

GitHub Advisory PRIMARY 8.1 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH
Red Hat 7.5 HIGH

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
May 07, 2026 - 20:02 EUVD
CVE Published
May 07, 2026 - 18:19 nvd
HIGH 8.1

DescriptionGitHub Advisory

GitPython is a python library used to interact with Git repositories. Prior to version 3.1.47, _clone() validates multi_options as the original list, then executes shlex.split(" ".join(multi_options)). A string like "--branch main --config core.hooksPath=/x" passes validation (starts with --branch), but after split becomes ["--branch", "main", "--config", "core.hooksPath=/x"]. Git applies the config and executes attacker hooks during clone. This issue has been patched in version 3.1.47.

Executive ViewAI

Why It Matters

GitPython versions before 3.1.47 contain a remote code execution vulnerability allowing unauthenticated attackers to execute arbitrary commands on systems performing Git repository clones. Any application using GitPython to clone repositories-including CI/CD pipelines, deployment automation, and dependency management tools-can be compromised without user interaction, enabling attackers to inject malicious code into the development pipeline or deployed applications.

Business Impact: High
Compensating Controls

Vendor-released patch: GitPython 3.1.47. Until patched, implement network-level restrictions limiting Git clone operations to trusted repository sources only; disable automated repository cloning from untrusted origins; isolate affected systems from production environments; monitor Git clone operations for embedded configuration injection patterns.

Threat Intelligence Overview

EPSS Score
0.0%
Top 86% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

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.0%
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
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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-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-67323 HIGH POC
8.6 Aug 01

Command injection and arbitrary file overwrite in GitPython before 3.1.51 expose applications that pass attacker-control

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-67322 HIGH POC
8.7 Aug 01

Environment variable exfiltration in GitPython before 3.1.52 allows any attacker who controls a URL passed to `Repo.clon

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

Vendor StatusVendor

SUSE

Severity: High
Product Status
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Affected
SUSE Linux Enterprise Module for Python 3 15 SP7 Affected

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