CVE-2026-76222

GitPython before 3.1.58 Path Traversal via .gitmodules Submodule Name

Published Aug 19, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

GitPython versions before 3.1.58 do not validate the names of submodules defined in a .gitmodules file. A malicious repository can embed traversal sequences such as '../' in a submodule name, which GitPython will process during submodule initialization. The result is that GitPython creates a new Git repository at a path outside the intended clone directory, allowing an attacker to write or modify files wherever the process has permission. This flaw can be used to place files that may be executed later, potentially leading to unauthorized code execution or persistence.

Affected Systems

The vulnerability affects the GitPython library developed by the GitPython developers. All releases earlier than 3.1.58 are impacted. Any application that uses GitPython to clone or initialize submodules from untrusted repositories is exposed.

Risk and Exploitability

The CVSS score of 8.4 marks the flaw as high severity. The EPSS score of < 1% indicates a very low likelihood of public exploitation, and the vulnerability is not listed in the CISA KEV catalog. Attackers can deliver a crafted .gitmodules file to a system where GitPython runs, causing the library to initialize submodules and create repositories at arbitrary filesystem locations. The likely attack vector is remote when the library is used in services that process untrusted repository data, but the absence of a high EPSS suggests that exploitation has not been widely observed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade GitPython to version 3.1.58 or later
  • Reject or sanitize submodule names containing traversal patterns in .gitmodules files as a temporary workaround
  • Run GitPython in a sandboxed or restricted environment to limit filesystem access

Generated by OpenCVE AI on August 20, 2026 at 17:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
Github GHSA Github GHSA GHSA-hmq2-w58f-27jc GitPython: Arbitrary Git Repository Creation Outside the Working Tree via Unvalidated .gitmodules Submodule Name in GitPython
History
Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython
Type Values Removed Values Added
Description 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.
Title GitPython before 3.1.58 Path Traversal via .gitmodules Submodule Name
First Time appeared Gitpython Project
Gitpython Project gitpython
Weaknesses CWE-22
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
References
Metrics cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L'}

cvssV4_0

{'score': 8.4, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:H/SA:L'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:25 PM
Reserved
Aug 19, 2026, 11:35 AM
Status
Analyzed
Published
Aug 19, 2026, 2:17 PM
Modified
Sep 2, 2026, 7:37 PM
Severity
Important
Public date
Aug 19, 2026, 2:02 PM