CVE-2026-76222: GitPython: Arbitrary Git Repository Creation Outside the Working Tree via Unvalidated .gitmodules Submodule Name in GitPython

CVE-2026-76222 · Severity: medium · CVSS 4 · Published 2026-08-19

GitPython before 3.1.58 fails to validate submodule names from .gitmodules files, allowing attackers to create Git repositories at arbitrary filesystem paths outside the intended clone directory. Attackers can craft malicious repositories with traversal sequences in submodule names that GitPython processes during submodule initialization, creating attacker-controlled Git repositories at escaped filesystem locations.

Technologies: gitpython (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-76222 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-76222 being exploited in the wild.
How severe is CVE-2026-76222?
Medium severity, with a CVSS score of 4, published 19 August 2026.
Which products and versions are affected?
gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.58.
Is there a fix for CVE-2026-76222?
Yes. gitpython (PyPI): upgrade to 3.1.58 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2026-76222?
Check whether you run gitpython (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gitpython (PyPI): upgrade to 3.1.58 or later
    pip install "gitpython>=3.1.58"

Affected products

  • gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.58

Identifiers

  • CVE-2026-76222
  • GHSA-hmq2-w58f-27jc
  • PYSEC-2026-3784

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.