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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.23 | py3-gitpython | 3.1.49-r0 | ALPINE-CVE-2026-42215 |
| Alpine:v3.24 | py3-gitpython | 3.1.49-r0 | ALPINE-CVE-2026-42215 |
| Debian:12 | python-git | 3.1.30-1+deb12u3 | DEBIAN-CVE-2026-42215 |
| Debian:13 | python-git | 3.1.44-1+deb13u1 | DEBIAN-CVE-2026-42215 |
| Debian:14 | python-git | 3.1.50-1 | DEBIAN-CVE-2026-42215 |
| PyPI | gitpython | 3.1.47 | PYSEC-2026-2160 |
| PyPI | gitpython | 3.1.47 | GHSA-rpm5-65cw-6hj4 |
| Ubuntu:25.10 | python-git | no fix listed | UBUNTU-CVE-2026-42215 |
| Ubuntu:26.10 | python-git | no fix listed | UBUNTU-CVE-2026-42215 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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