Skip to main content
VulnerabilityPublished Updated

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

Affects GitPythonSource GCVE Database

0

Mentioned vulnerabilities

CVSS 8.2 High : upgrade to 3.1.58 soon.

Data as of 26 Oct 2026, 16:15 UTC

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

What to do

Upgrade GitPython to 3.1.58.

Affected software

ProductAffectedFixed in
PyPIGitPythonAffected
  • <3.1.58
Fixed in
  • 3.1.58

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

AI-suggested

A patch is available in GitPython version 3.1.58 that addresses this vulnerability by validating submodule names to prevent directory traversal. Users should upgrade to GitPython 3.1.58 or later. Until upgraded, avoid cloning and initializing submodules from untrusted repositories using GitPython. Core Git itself is not affected as it already blocks this attack class. No additional mitigations are indicated by the vendor advisory.

Description

GitPython versions prior to 3.1.58 contain a vulnerability where an attacker-controlled submodule name in a cloned repository's .gitmodules file can cause GitPython to create and initialize a Git repository outside the intended working directory. This occurs because GitPython does not validate the submodule name, allowing directory traversal sequences that lead to repository creation at arbitrary filesystem paths during submodule initialization.

References

Community reviews

Loading reviews…