Description
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.
Published: 2026-05-07
Score: 8.8 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

GitPython allows an attacker to inject Git command options via keyword arguments that bypass the library’s built‑in filtering. The vulnerability exists in functions that accept arbitrary kwargs, such as Repo.clone_from, Remote.fetch, Remote.pull, and Remote.push. When an attacker supplies crafted values for the upload_pack or receive_pack arguments, the library constructs a Git command that includes the supplied argument, resulting in uncontrolled execution of shell commands and a complete loss of confidentiality, integrity, and availability for the affected system.

Affected Systems

The flaw affects the GitPython library, and specifically applies to any software using GitPython versions between 3.1.30 inclusive and 3.1.47 exclusive. These products are maintained by the gitpython‑developers community. The issue is resolved as of release 3.1.47.

Risk and Exploitability

The vulnerability received a CVSS base score of 8.8, indicating high severity. Although no EPSS score is available, the lack of prior public exploitation combined with the high impact suggests that attackers could target vulnerable deployments if they gain access to a codebase that utilizes GitPython. The KEV status is not listed, so no active exploitation is known in the wild. Because the GitPython functions are typically called from application code, an attacker would need to supply malicious arguments to a function that receives user input or another controllable source.

Generated by OpenCVE AI on May 7, 2026 at 20:50 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update the GitPython library to version 3.1.47 or later to apply the vendor patch
  • Verify that all instances of Repo.clone_from, Remote.fetch, Remote.pull, and Remote.push in your code do not receive arbitrary keyword arguments from untrusted sources
  • Consider implementing input validation to reject or sanitize 'upload_pack' and 'receive_pack' arguments if upgrading is not immediately possible

Generated by OpenCVE AI on May 7, 2026 at 20:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-rpm5-65cw-6hj4 GitPython has Command Injection via Git options bypass
History

Fri, 08 May 2026 22:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 07 May 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
Vendors & Products Gitpython Project
Gitpython Project gitpython

Thu, 07 May 2026 19:00:00 +0000

Type Values Removed Values Added
Description 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.
Title GitPython: Command injection via Git options bypass
Weaknesses CWE-78
References
Metrics cvssV3_1

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


Subscriptions

Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-09T03:56:00.861Z

Reserved: 2026-04-25T05:04:37.028Z

Link: CVE-2026-42215

cve-icon Vulnrichment

Updated: 2026-05-08T14:39:34.148Z

cve-icon NVD

Status : Undergoing Analysis

Published: 2026-05-07T19:16:01.640

Modified: 2026-05-08T22:16:32.523

Link: CVE-2026-42215

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-07T21:24:32Z

Weaknesses