---
id: CVE-2026-100689
title: >-
  GitPython before 3.1.62 does not validate the `path` field read from an
  untrusted .gitmodules file when updating submodules
summary: >-
  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 Git…
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L'
cwe:
  - CWE-22
vendor: gitpython-developers
product: GitPython
affected:
  - GitPython < 3.1.62
published: '2026-09-26'
updated: '2026-09-30'
sourceUpdated: '2026-09-30T18:18:01.610'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-100689'
references:
  - url: >-
      https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-59cr-6r3x-644w
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/gitpython-before-3.1.62-path-traversal-via-gitmodules-path
    label: disclosure@vulncheck.com
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-100689.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-100689'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2541824'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-100689'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-100689'
  - url: 'https://github.com/gitpython-developers/GitPython/pull/2225'
  - url: >-
      https://github.com/gitpython-developers/GitPython/commit/1ed0ebc2f2e74d979cdc367a4864a7731fdcc093
  - url: 'https://github.com/gitpython-developers/GitPython'
  - url: 'https://github.com/gitpython-developers/GitPython/releases/tag/3.1.62'
tags:
  - nvd
  - cve.org
  - csaf
  - vex
  - red-hat
  - osv
  - pip
epss: 0.00401
epssPercentile: 0.34213
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-30T17:41:00.466396Z'
ingestedAt: '2026-09-26T13:33:20.906Z'
aliases:
  - GHSA-59cr-6r3x-644w
ecosystem: pip
patched:
  - gitpython 3.1.62
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **Red Hat VEX** · Moderate · affected: Exploit Intelligence, Migration Toolkit for Applications 8, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI), … · no fix planned: Exploit Intelligence, Migration Toolkit for Applications 8, Red Hat Ansible Automation Platform 2, Red Hat OpenStack Platform 13 (Queens), … · updated 2026-09-26 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-100689.json)

## Package advisory (CVE-2026-100689)

Affected packages:

- `gitpython < 3.1.62`

Patched in:

- `gitpython 3.1.62`

Source: https://osv.dev/vulnerability/GHSA-59cr-6r3x-644w
