Command Injection via Git Option Kwarg Bypass in GitPython
CVE-2026-42215 is a command-injection vulnerability in GitPython versions 3.1.30 through 3.1.46. GitPython’s unsafe-option protection blocks dangerous Git options such as --upload-pack and --receive-pack, but performs the check before Python-style keyword arguments are transformed into Git option names. Consequently, the upload_pack and receive_pack keyword arguments bypass the protection and can reach the underlying Git subprocess. Applications that pass attacker-controlled keyword arguments to Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push() can permit arbitrary command execution despite leaving allow_unsafe_options set to False.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
A successful exploit permits arbitrary command execution in the context of the process running the vulnerable GitPython operation.
If you can’t patch tonight, do this now.
No vendor-accepted mitigation is available as a substitute for applying the fix. Until upgraded, applications should never forward untrusted or dynamically constructed keyword-argument dictionaries to GitPython repository and remote operations. Enforce a strict application-side allowlist of accepted parameters and reject options that can select Git helper programs, including upload-pack and receive-pack equivalents.
Patch, then assume compromise.
Upgrade GitPython to version 3.1.47 or later.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
17 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.