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.

Severity (CVSS 3.1)8.1High
Exploit odds (30 days)0.6%top 52.6% 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. 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

EcosystemPackageFixed inAdvisory
Alpine:v3.23py3-gitpython3.1.49-r0ALPINE-CVE-2026-42284
Alpine:v3.24py3-gitpython3.1.49-r0ALPINE-CVE-2026-42284
Debian:12python-git3.1.30-1+deb12u3DEBIAN-CVE-2026-42284
Debian:13python-git3.1.44-1+deb13u1DEBIAN-CVE-2026-42284
Debian:14python-git3.1.50-1DEBIAN-CVE-2026-42284
PyPIgitpython3.1.47PYSEC-2026-2161
PyPIgitpython3.1.47GHSA-x2qx-6953-8485
Ubuntu:25.10python-gitno fix listedUBUNTU-CVE-2026-42284
Ubuntu:26.10python-gitno fix listedUBUNTU-CVE-2026-42284

Affected products (as reported)

VendorProductVersions
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

References