CVE-2026-100689

GitPython before 3.1.62 Path Traversal via gitmodules path

Published Sep 26, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
GitPython before 3.1.62 does not validate the `path` field read from an untrusted .gitmodules file when updating submodules. While a prior fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to constrain the `name` field, and GitPython's own containment guard Submodule._to_relative_path() is applied in add() and move(), Submodule.update() derives the absolute checkout location from the raw `path` value without that guard. A .gitmodules entry containing directory traversal components (e.g., path = ../../../tmp/escaped) can therefore cause directories to be created via os.makedirs() outside the repository working tree, populated from the submodule URL on the clone path, and removed via shutil.rmtree() when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit (such as a historical-commit API); the common clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. The issue is fixed in GitPython 3.1.62.

Analysis

AI-generated

Technical impact

GitPython before version 3.1.62 fails to sanitize the `path` field read from an untrusted .gitmodules file during a submodule update. The vulnerability allows directories and files to be created or removed outside the repository working tree via traversal components, enabling arbitrary file writes or deletions that could lead to code execution by an attacker controlling the .gitmodules data. This is a path traversal weakness (CWE‑22).

Affected Systems

The problem affects the GitPython library maintained by the GitPython developers. Any deployment using GitPython versions earlier than 3.1.62 that performs submodule updates without restricting the .gitmodules source is potentially vulnerable.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity. Exploitation requires an application that updates submodules at a non‑HEAD commit, which is a less common but still possible workflow. The EPSS score is not available and the vulnerability is not listed in CISA’s KEV catalog, but the high CVSS suggests a significant risk should an attacker achieve the necessary state. Operators should treat this as a serious threat to confidentiality, integrity, and availability of affected systems.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the GitPython library to version 3.1.62 or later.
  • Audit current projects for submodule update logic that may process untrusted .gitmodules files and restrict such operations to trusted sources only.
  • Scan existing repository clones for malicious .gitmodules entries and validate path values before performing submodule updates.

Generated by OpenCVE AI on September 26, 2026 at 16:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', '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.62 does not validate the `path` field read from an untrusted .gitmodules file when updating submodules. While a prior fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to constrain the `name` field, and GitPython's own containment guard Submodule._to_relative_path() is applied in add() and move(), Submodule.update() derives the absolute checkout location from the raw `path` value without that guard. A .gitmodules entry containing directory traversal components (e.g., path = ../../../tmp/escaped) can therefore cause directories to be created via os.makedirs() outside the repository working tree, populated from the submodule URL on the clone path, and removed via shutil.rmtree() when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit (such as a historical-commit API); the common clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. The issue is fixed in GitPython 3.1.62.
Title GitPython before 3.1.62 Path Traversal via gitmodules path
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': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L'}

cvssV4_0

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

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:21 PM
Reserved
Sep 26, 2026, 2:37 AM
Status
Awaiting Analysis
Published
Sep 26, 2026, 2:16 PM
Modified
Sep 30, 2026, 6:18 PM
Severity
Moderate
Public date
Sep 26, 2026, 1:23 PM