Vulnerability · Published May 7, 2026 · Assigned by GitHub_M

CVE-2026-42215GitPython: Command injection via Git options bypass

High 8.8

In plain English

A high-severity OS command injection in GitPython from gitpython-developers. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 55% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)0.7%top 44.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.23py3-gitpython3.1.49-r0ALPINE-CVE-2026-42215
Alpine:v3.24py3-gitpython3.1.49-r0ALPINE-CVE-2026-42215
Debian:12python-git3.1.30-1+deb12u3DEBIAN-CVE-2026-42215
Debian:13python-git3.1.44-1+deb13u1DEBIAN-CVE-2026-42215
Debian:14python-git3.1.50-1DEBIAN-CVE-2026-42215
PyPIgitpython3.1.47PYSEC-2026-2160
PyPIgitpython3.1.47GHSA-rpm5-65cw-6hj4
Ubuntu:25.10python-gitno fix listedUBUNTU-CVE-2026-42215
Ubuntu:26.10python-gitno fix listedUBUNTU-CVE-2026-42215

Affected products (as reported)

VendorProductVersions
gitpython-developers GitPython >= 3.1.30, < 3.1.47

Weakness: CWE-78 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

References