Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
Back to intelligence
open-source-dependency-vulnerabilityproof-of-concept-releasewidely-deployed-product-advisoryinitial-access-method

GitPython Flaws Let Attackers Bypass Option Checks and Execute Commands

Updated 2mo agoFirst seen Apr 27, 20263 sources

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.

Share:
GitPython Flaws Let Attackers Bypass Option Checks and Execute Commands
Stay ahead

Get ahead of threats like this

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.

EVENT TIMELINE

How this story unfolded

2 events from the most recent confirmed update back to the earliest known activity.

2 EVENTS
May 7, 20262mo ago

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.

Apr 25, 20262mo ago

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.

The operational view lives in Mallory

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t — which of your assets are affected, which threat actors are using it right now, which detections to deploy, and what to do next.
Exposure mapping

Map indicators from this story to your assets and identify affected systems in minutes.

Threat actor evidence

Every observed campaign, victim, and pivot linked to actors named in this story.

Associated malware

Malware, exploits, and IOCs connected to the activity described here.

Detection signatures

YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.

Scheduled alerts

Get matching new stories delivered to your team as they break — not the next morning.

AI threads

Ask questions about this story and take action on the answers.

GitPython Flaws Let Attackers Bypass Option Checks and Execute Commands | Mallory