CVE-2026-42284
GitPython: Unsafe option check validates multi_options before shlex.split transforms it
CRITICAL 9.8EPSS 0.7%
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
- gitpython-developers · GitPython
- CVSS v3.1 NVD
- 9.8 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS v3.1 GITHUB
- 8.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - EPSS
- 0.71% chance of exploitation in the next 30 days, 53rd percentile
- Published
- 2026-05-07
- Updated
- 2026-05-09
Proof-of-concept exploits (1)
Security advisories
- gitpython-developers/GitPython/security/advisories/GHSA-x2qx-6953-8485
- gitpython-developers/GitPython/releases/tag/3.1.47