GitPython Flaws Let Attackers Bypass Option Checks and Execute Commands
Two high-severity vulnerabilities in GitPython allowed attackers to bypass built-in safety checks and reach arbitrary command execution through Git operations. CVE-2026-42215 affects versions 3.1.30 through 3.1.46 and stems from GitPython validating blocked Git options before normalizing Python keyword arguments: values such as upload_pack could pass validation, then be converted into forbidden flags like --upload-pack when passed to Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push(). The flaw could let attacker-controlled input trigger command execution with the privileges of the Python process even when allow_unsafe_options=False.
A second flaw, CVE-2026-42284, affects GitPython before version 3.1.47 and involves unsafe handling of the multi_options parameter in _clone(). The library checked multi_options before later reprocessing it with shlex.split(" ".join(multi_options)), enabling crafted input to smuggle additional Git command-line arguments past validation. A string that appeared to be a valid branch selection could be split into separate options, including malicious configuration such as core.hooksPath, causing Git to execute attacker-controlled hooks during clone. Both issues were fixed in GitPython 3.1.47.

Get ahead of threats like this
Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
How this story unfolded
2 events from the most recent confirmed update back to the earliest known activity.
GitPython fixes two clone/option injection vulnerabilities in version 3.1.47
GitPython version 3.1.47 fixed the command injection issue involving unsafe Git option bypass as well as a separate flaw in _clone() where multi_options were validated before being reprocessed with shlex.split. The latter bug allowed attackers to smuggle additional Git options that could apply malicious configuration and trigger attacker-controlled hooks during clone.
GitPython command injection flaw is publicly disclosed
A command execution vulnerability in GitPython was publicly disclosed, affecting versions 3.1.30 through 3.1.46. The flaw allowed dangerous Git options to bypass blocklist checks when supplied as Python keyword arguments that were later normalized into Git command-line flags.
Sources
3 references tracked. Mallory keeps watching after this page renders.
CVE-2026-42284 - GitPython: Unsafe option check validates multi_options before shlex.split transforms it
cvefeed.io
Open sourceCVE-2026-42215 - GitPython: Command injection via Git options bypass
cvefeed.io
Open sourceGHSA-RPM5-65CW-6HJ4: GHSA-RPM5-65CW-6HJ4: Command Injection via Git Options Bypass in GitPython | CVEReports
cvereports.com
Open sourceSee the full picture, correlated to your attack surface.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.


