Skip to main content

GitPython CVE-2026-42215

| EUVDEUVD-2026-28411 HIGH
OS Command Injection (CWE-78)
2026-05-07 GitHub_M GHSA-rpm5-65cw-6hj4
8.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Access
    Authenticate to target application
  2. Delivery
    Submit crafted kwargs with underscore-formatted Git options (upload_pack=/path/to/payload)
  3. Exploit
    Application passes kwargs to GitPython remote operation
  4. Execution
    GitPython validation bypass (underscore normalization)
  5. Persist
    Git executes attacker-specified helper command
  6. 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 OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Applications must accept attacker-controlled input into kwargs dictionaries passed to GitPython's Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push() methods. Vulnerable code pattern: repo.remote('origin').fetch(**user_supplied_dict) or similar constructions where dictionary keys/values originate from untrusted sources (HTTP parameters, API inputs, configuration files writable by lower-privileged users). Attack requires authenticated access (PR:L in CVSS vector) to the application layer invoking GitPython, but does not require local system access or privileged Git repository permissions. Does NOT require allow_unsafe_options=True since the bypass defeats the default False protection. Limits exploitation: applications that hard-code all GitPython kwargs without external input are not vulnerable; applications performing strict kwarg key whitelisting before GitPython invocation prevent the bypass; Python environments without shell command execution capabilities (highly restricted sandboxes) limit impact but do not prevent injection attempts.

Impact

CVSS 8.8 (AV:N/AC:L/PR:L/UI:N) indicates network-exploitable command injection requiring authenticated access with no user interaction and high impact across confidentiality, integrity, and availability. Real-world risk depends heavily on application architecture: only affects applications that (1) accept untrusted input into GitPython API kwargs and (2) expose git remote operations to authenticated users. The PR:L requirement significantly reduces attack surface compared to unauthenticated RCE. No CISA KEV listing or EPSS data suggests exploitation remains limited to security research contexts rather than active campaigns. Publicly available exploit code exists (GitHub advisory GHSA-rpm5-65cw-6hj4 with technical details and POC paths). Patch availability in version 3.1.47 since the advisory release enables straightforward remediation. Priority is HIGH for applications exposing GitPython remote operations with user-controlled parameters, MEDIUM for applications using GitPython with authenticated-only access to kwargs, LOW for applications that hard-code all GitPython parameters without external input.

Exploit ScenarioDerived

An authenticated attacker with access to a Python application using GitPython identifies a code path where user input controls kwargs passed to remote.fetch(). The attacker crafts a request setting upload_pack='/usr/bin/malicious-script' which bypasses GitPython's unsafe option check due to underscore formatting. When the application executes remote.fetch(upload_pack=attacker_value), Git invokes the attacker's script during the fetch operation, achieving arbitrary command execution in the application's context. GitHub advisory GHSA-rpm5-65cw-6hj4 provides proof-of-concept demonstrating the bypass mechanism.

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

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

Alert me

AnalysisAIv1 – May 07, 2026

Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via underscore-formatted kwargs that bypass unsafe option validation. Applications passing attacker-controlled kwargs to Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push() are vulnerable even when allow_unsafe_options=False (default). GitHub-confirmed exploit with vendor-released patch 3.1.47. CVSS 8.8 reflects network vector with low complexity and authenticated access; no EPSS/KEV data indicates exploitation not yet widespread beyond proof-of-concept demonstration.

RemediationAI

Upgrade GitPython to version 3.1.47 or later via pip install --upgrade GitPython==3.1.47 per release notes at https://github.com/gitpython-developers/GitPython/releases/tag/3.1.47. If immediate upgrade is not feasible, implement strict input validation by whitelisting allowed kwargs before passing to Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push() functions-specifically reject any kwargs containing underscore-formatted Git option names (upload_pack, receive_pack, exec). Alternatively, avoid passing user-controlled dictionaries directly as **kwargs; instead construct kwargs from hardcoded safe parameters only. Note that setting allow_unsafe_options=False (default) does NOT prevent this bypass. Defense-in-depth: run GitPython operations in sandboxed environments with restricted shell access and apply principle of least privilege to service accounts executing git commands, though these mitigations only reduce impact post-exploitation rather than preventing command injection itself. Vendor advisory at https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-rpm5-65cw-6hj4 provides additional technical context.

Affected VersionsENISA

GitPython 3.1.30, < 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 Git repository interaction. The vulnerability (CWE-78 OS Command Injection) stems from a validation bypass in Git.check_unsafe_options() at git/cmd.py:948-961. GitPython blocks dangerous Git options like --upload-pack and --receive-pack by checking raw kwargs keys before normalization, but Git.transform_kwarg() at git/cmd.py:1471-1484 subsequently converts Python-style underscore kwargs (upload_pack, receive_pack) into dashed command-line flags (--upload-pack, --receive-pack). Because validation runs before this dashification step, underscore-form kwargs bypass the safety check entirely, allowing attacker-supplied helper commands to execute via git clone/fetch/pull/push operations. The CPE cpe:2.3:a:gitpython-developers:gitpython applies to pip package GitPython versions 3.1.30 through 3.1.46.

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.8 HIGH
AV:N/AC:L/PR:L/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
Low
Privileges Required
Low
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:17 nvd
HIGH 8.8

DescriptionGitHub Advisory

GitPython is a python library used to interact with Git repositories. From version 3.1.30 to before version 3.1.47, GitPython blocks dangerous Git options such as --upload-pack and --receive-pack by default, but the equivalent Python kwargs upload_pack and receive_pack bypass that check. If an application passes attacker-controlled kwargs into Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push(), this leads to arbitrary command execution even when allow_unsafe_options is left at its default value of False. This issue has been patched in version 3.1.47.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 53 pypi packages depend on gitpython (53 direct, 0 indirect)

Ecosystem-wide dependent count for version 3.1.30.

Executive ViewAI

Why It Matters

GitPython versions 3.1.30 through 3.1.46 contain a command injection vulnerability allowing authenticated attackers to execute arbitrary commands through improperly validated function arguments, affecting any application using Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push() operations. Organizations deploying GitPython in CI/CD pipelines, repository management tools, or development automation should prioritize assessment and remediation to prevent supply chain compromise and unauthorized code execution.

Business Impact: High
Compensating Controls

Vendor-released patch: GitPython 3.1.47. Apply immediately. Interim mitigation if immediate patching unavailable: restrict network access to Git remote repositories to trusted sources only; disable or sandbox applications accepting user input for Git operations; implement WAF/proxy rules to block suspicious Git command syntax in application logs.

Threat Intelligence Overview

EPSS Score
0.1%
Top 75% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL 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 Yes
EPSS 0.1%
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

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

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

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