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.
Published: 2026-08-19
Score: 8.4 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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
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

Wed, 02 Sep 2026 19:45:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Tue, 25 Aug 2026 02:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 19 Aug 2026 19:15:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython

Wed, 19 Aug 2026 14:15:00 +0000

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'}


Subscriptions

Gitpython-developers Gitpython
Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-25T01:57:22.297Z

Reserved: 2026-08-19T11:35:13.689Z

Link: CVE-2026-76222

cve-icon Vulnrichment

Updated: 2026-08-25T01:57:09.714Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-19T14:17:48.603

Modified: 2026-09-02T19:37:05.047

Link: CVE-2026-76222

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-19T14:02:05Z

Links: CVE-2026-76222 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T17:15:04Z

Weaknesses
  • CWE-22

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