Skip to main content
VulnerabilityPublished Updated

CVE-2026-42215: Legit · GitPython has Command Injection via Git options bypass

Affects legitSource GCVE Database

0
Authoritative record:CVE-2026-42215· High 8.8

Not known to be exploited · CVSS 8.8 High : upgrade to 1.2.0.post0_9 soon.

Data as of 26 Oct 2026, 19:12 UTC

CVSS 3.1 base score
8.8High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.2.0.post0_9
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 7 May 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade legit to 1.2.0.post0_9.

Affected software

ProductAffectedFixed in
Homebrewlegitpkg:brew/legitOther threatsAffected
  • >=1.2.0.post0_3 <1.2.0.post0_9
Fixed in
  • 1.2.0.post0_9

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade GitPython to version 1.2.0.post0_9 or later, where this vulnerability is fixed. The patch corrects the unsafe option validation to properly handle underscore-form kwargs. Until upgraded, avoid passing untrusted input as kwargs to Repo.clone_from(), Remote.fetch(), Remote.pull(), or Remote.push().

Description

GitPython versions from 1.2.0.post0_3 up to but not including 1.2.0.post0_9 contain a command injection vulnerability. This occurs because unsafe Git options like --upload-pack and --receive-pack are blocked when passed as hyphenated kwargs, but the equivalent underscore-form kwargs bypass the safety checks and allow arbitrary command execution. This affects API methods such as Repo.clone_from(), Remote.fetch(), Remote.pull(), and Remote.push(). A fix is available in version 1.2.0.post0_9.

References

Community reviews

Loading reviews…