Skip to main content

GitPython EUVDEUVD-2026-51805

| CVE-2026-67323 HIGH
Command Injection (CWE-77)
8.6
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Identify network-facing endpoint calling vulnerable GitPython method
  2. Delivery
    Supply malicious kwarg or revision string as user input
  3. Exploit
    GitPython builds git argv without unsafe-option check
  4. Execution
    Git binary parses attacker-supplied option
  5. Impact
    Execute arbitrary OS command or truncate arbitrary file on server

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Command injection prevention
MITRE ATT&CK

1 technique 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

Exploitation of the command injection vectors (Repo.archive(), git.ls_remote()) requires that the consuming application pass attacker-controlled keyword arguments to these GitPython methods - for example, a web or API endpoint that maps user-submitted parameters directly to git archive options or git remote URLs. Exploitation of the file-overwrite vectors (Repo.iter_commits(), Repo.blame()) requires that an attacker control the revision string argument passed to these methods without prior sanitization. What limits exploitation: applications that hardcode all arguments to the affected methods, or that validate inputs before calling GitPython, are not exploitable regardless of version. Standard git protocol settings (protocol.ext.allow) do not prevent the --exec vector in git archive --remote usage per the GHSA advisory. The CVSS 4.0 PR:N indicates no OS-level privileges are required once the application-layer precondition (attacker-controlled input reaching the methods) is satisfied.

Impact

The provided CVSS 4.0 score of 8.6 with vector AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H reflects a local attack vector, which describes the library's process-execution context rather than the network reachability of applications consuming GitPython. In practice, CI/CD pipelines, developer portals, and self-hosted Git management services that accept user-supplied branch names, archive options, or remote URLs and pass them to the affected methods are exposed to network-sourced exploitation, making AV:L a potential understatement of real-world attack surface. No EPSS score was provided, and neither a public proof-of-concept exploit nor a CISA KEV entry is present in the input data, so exploitation probability cannot be quantified from these signals. The vulnerability is not a zero-day - a detailed GHSA advisory describes the exact code paths, lowering the bar for exploit development. Risk is highest for organizations running GitPython-backed web services with unsanitized user input; risk is negligible where all arguments to the affected methods are fully hardcoded. The patch is a low-disruption library upgrade, making the cost of remediation minimal relative to the potential impact of arbitrary command execution.

Exploit ScenarioDerived

A self-hosted code review platform accepts a user-supplied archive format and optional remote URL, passing them as kwargs to Repo.archive(treeish=user_branch, **user_options); an attacker submits {"remote": ".", "exec": "/bin/bash -c 'id > /tmp/pwned'"}, causing GitPython to invoke git archive --remote=. --exec=/bin/bash -c 'id > /tmp/pwned', which triggers git-upload-archive with the attacker-controlled executable and achieves arbitrary command execution in the server process. No public proof-of-concept exploit was identified at time of analysis, but the detailed GHSA advisory fully describes the code path, significantly reducing development effort for a working exploit.

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

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

Alert me

AnalysisAIv1 – Aug 01, 2026

Command injection and arbitrary file overwrite in GitPython before 3.1.51 expose applications that pass attacker-controlled arguments to four public API methods. Repo.archive() and git.ls_remote() forward caller-supplied keyword arguments into the git argument vector without consulting GitPython's own unsafe-options denylist, enabling arbitrary command execution via options such as --exec or --upload-pack. Repo.iter_commits() and Repo.blame() accept unsanitized revision strings without a leading-dash check, so a value like --output=/path/to/file is interpreted by git as an option, truncating an arbitrary file. No public exploit code or CISA KEV listing was identified at time of analysis; a vendor-released patch is available in 3.1.51.

RemediationAI

Upgrade GitPython to version 3.1.51 or later via pip install --upgrade 'GitPython>=3.1.51'; this release extends check_unsafe_options() enforcement to Repo.archive() and git.ls_remote() and adds leading-dash validation to revision parameters in Repo.iter_commits() and Repo.blame(). The upstream fix is confirmed in PR https://github.com/gitpython-developers/GitPython/pull/2163 and commit https://github.com/gitpython-developers/GitPython/commit/701ce32fe5ba8cb622c0e0342a376a6beb47d738. If an immediate upgrade is not feasible, applications should sanitize all arguments before calling the affected methods: reject any kwarg key or value matching --exec, --upload-pack, --receive-pack, or any leading-dash pattern, and validate that revision strings do not begin with - before passing them to iter_commits() or blame(). As a compensating control, restricting outbound network access of the git subprocess (via network namespaces or egress firewall rules) limits the usefulness of command injection for establishing reverse shells but does not prevent local command execution or file clobber. Refer to the vendor advisory at https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-956x-8gvw-wg5v for full mitigation guidance.

Affected VersionsENISA

GitPython 0 <3.1.51

Affected Packages

pypi gitpython fix: 3.1.51

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 that wraps the system git binary by constructing argument vectors programmatically and spawning subprocesses. It maintains an explicit denylist of dangerous options (--upload-pack, --receive-pack, --exec, -c, --config) enforced via Git.check_unsafe_options() at git/cmd.py:963, but this guard is wired only to the network-facing commands (clone_from, Remote.fetch, Remote.pull, Remote.push). CWE-77 (Improper Neutralization of Special Elements used in a Command) applies because Repo.archive() blindly forwards **kwargs to git archive, allowing --exec=<cmd> to override the helper binary invoked by git archive --remote, and git.ls_remote() similarly passes upload_pack=<cmd> as --upload-pack=<cmd> with no guard. The file-overwrite primitive in Repo.iter_commits() and Repo.blame() arises because the caller's revision string is inserted into the argv before the -- end-of-options separator; git therefore interprets a leading-dash value (e.g., --output=/etc/crontab) as a legitimate option, truncating the target file before validating the revision. The affected CPE is cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:* for all versions prior to 3.1.51.

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.6 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 9.0 CRITICAL

Network vector because consuming applications are typically network-facing; AC:H because exploitation requires the application to pass attacker-controlled arguments to specific GitPython methods, a non-default pattern not present in all deployments.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
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 01, 2026 - 13:01 EUVD
CVE Published
Aug 01, 2026 - 12:22 cve.org
HIGH 8.6

DescriptionCVE.org

GitPython before 3.1.51 fails to guard against dangerous Git options passed as keyword arguments in Repo.archive() and git.ls_remote(), allowing command injection via options such as --exec/--upload-pack (leading to arbitrary command execution). Additionally, Repo.iter_commits() and Repo.blame() do not check for leading-dash revision arguments, so a revision like --output=<path> can cause Git to open and truncate an arbitrary file. Exploitation requires an application that passes attacker-controlled arguments to these methods.

Blast Radius

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

Ecosystem-wide dependent count for version 3.1.51.

Executive ViewAI

Why It Matters

GitPython, a widely-used Python library for Git repository management, contains a vulnerability in versions before 3.1.51 that could allow attackers to execute arbitrary code or modify files on systems running affected software. Development teams, CI/CD systems, and any automation tools relying on GitPython are at risk of compromise. The availability of a vendor patch requires immediate assessment and deployment across the organization.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
1.0%
Top 40% exploitable
Prevalence
Medium
widely used Python Git library, common in CI/CD and developer tooling
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN 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 1.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
Small
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +43
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-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

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-2026-42284 CRITICAL
9.8 May 07

Argument injection in GitPython's clone helpers lets an attacker-controlled multi_options string slip past the unsafe-op

Vendor StatusVendor

SUSE

Severity: Important
Product Status
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

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