CVE-2026-67323

GitPython before 3.1.51 Command Injection via unguarded Git options

Published Aug 1, 2026 CVSS 4.0 · 8.6 High EPSS 1.3% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

GitPython versions earlier than 3.1.51 allow an attacker to inject arbitrary Git options when calling Repo.archive() or git.ls_remote(), passing options such as --exec or --upload-pack directly to the Git binary and yielding command execution. The methods Repo.iter_commits() and Repo.blame() also fail to reject leading-dash revision arguments, so a revision like --output=<path> can cause Git to create or truncate a file at an attacker‑controlled location, enabling data loss or tampering. This vulnerability is a command injection flaw (CWE‑77, CWE‑88).

Affected Systems

The vulnerability affects the GitPython project distributed by the gitpython‑developers. Versions before 3.1.51 are vulnerable; no other vendor or product details are listed.

Risk and Exploitability

The CVSS score of 8.6 indicates high severity, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires an application that forwards untrusted arguments to the affected methods, making the attack vector an application‑level privilege escalation that can lead to arbitrary command execution. The EPSS score of 1% indicates a low but non‑zero probability of exploitation, suggesting that while the vulnerability is serious, it is unlikely to be widely exploited at the time of analysis. This vulnerability is a command injection flaw (CWE‑77, CWE‑88).

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to GitPython 3.1.51 or newer, which validates and sanitizes Git options in all affected methods.
  • Verify that any arguments passed to Repo.archive(), git.ls_remote(), Repo.iter_commits(), and Repo.blame() do not originate from user‑controlled input or other untrusted sources.
  • If the application must use dangerous Git options such as --exec or --upload-pack, limit their use by configuring Git to run in a sandboxed environment or by restricting file system permissions to prevent unintended file creation or truncation.

Generated by OpenCVE AI on August 4, 2026 at 11:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
Github GHSA Github GHSA GHSA-956x-8gvw-wg5v GitPython: command injection via unguarded Git options in `Repo.archive()`, `git.ls_remote()`, and arbitrary file overwrite via `Repo.iter_commits()` / `Repo.blame()`
History
Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython
Type Values Removed Values Added
Description 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.
Title GitPython before 3.1.51 Command Injection via unguarded Git options
Weaknesses CWE-77
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, 'vector': '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'}

Weaknesses
  • CWE-77

    Improper Neutralization of Special Elements used in a Command ('Command Injection')

  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:24 PM
Reserved
Jul 29, 2026, 1:07 PM
Status
Analyzed
Published
Aug 1, 2026, 1:17 PM
Modified
Oct 23, 2026, 11:10 PM
Severity
Important
Public date
Aug 1, 2026, 12:22 PM