Vulnerability · Published May 7, 2026 · Assigned by GitHub_M
CVE-2026-42284GitPython: Unsafe option check validates multi_options before shlex.split transforms it
High 8.1
In plain English
A high-severity argument 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.6% (higher than 47% 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. Prior to version 3.1.47, _clone() validates multi_options as the original list, then executes shlex.split(" ".join(multi_options)). A string like "--branch main --config core.hooksPath=/x" passes validation (starts with --branch), but after split becomes ["--branch", "main", "--config", "core.hooksPath=/x"]. Git applies the config and executes attacker hooks during clone. 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-42284 |
| Alpine:v3.24 | py3-gitpython | 3.1.49-r0 | ALPINE-CVE-2026-42284 |
| Debian:12 | python-git | 3.1.30-1+deb12u3 | DEBIAN-CVE-2026-42284 |
| Debian:13 | python-git | 3.1.44-1+deb13u1 | DEBIAN-CVE-2026-42284 |
| Debian:14 | python-git | 3.1.50-1 | DEBIAN-CVE-2026-42284 |
| PyPI | gitpython | 3.1.47 | PYSEC-2026-2161 |
| PyPI | gitpython | 3.1.47 | GHSA-x2qx-6953-8485 |
| Ubuntu:25.10 | python-git | no fix listed | UBUNTU-CVE-2026-42284 |
| Ubuntu:26.10 | python-git | no fix listed | UBUNTU-CVE-2026-42284 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| gitpython-developers | GitPython | < 3.1.47 |
Weakness: CWE-88 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H