CVE-2026-110855
Info disclosure via env‑var expansion in GitPython <3.2 during clone/submodule update.
- CVSS 7.1
- CWE-200
- Information Leakage
- Remote
GitPython before 3.2.0 contains an information disclosure vulnerability that allows malicious repositories to expand environment variables via separate_git_dir in Repo._clone(), which omits expand_vars=False when calling Git.polish_url(). Attackers can craft a .gitmodules submodule name containing variable syntax so that clone plus submodule_update exposes secrets in .git/modules directory names and DEBUG logs.
- CWE
- CWE-200
- CVSS base score
- 7.1
- Published
- 2026-10-14
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Information Leakage
- Subcategory
- Information Disclosure
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- GitPython
- Fixed by upgrading
- Yes
Solution
Upgrade GitPython to version 3.2.0 or later.
Vulnerable code sample
import os
from git import Repo
def clone_and_update(url: str, dest: str):
# Clone the repository, allowing a separate .git directory
repo = Repo.clone_from(url, dest, multi_options=['--separate-git-dir=' + os.path.join(dest, '.git')])
# VULNERABLE: polish_url expands environment variables in submodule names
submodule_url = repo.git.polish_url('submodule_${HOME}')
# Trigger submodule update that would write the expanded path into .git/modules
repo.submodule_update(init=True, recursive=True, toplevel_path=dest, url=submodule_url)Patched code sample
import os
from git import Repo
def clone_and_update(url: str, dest: str):
# Clone the repository, allowing a separate .git directory
repo = Repo.clone_from(url, dest, multi_options=['--separate-git-dir=' + os.path.join(dest, '.git')])
# FIX: disable variable expansion when polishing URLs
submodule_url = repo.git.polish_url('submodule_${HOME}', expand_vars=False)
# Trigger submodule update that now uses the unexpanded path
repo.submodule_update(init=True, recursive=True, toplevel_path=dest, url=submodule_url)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix(repo): preserve literal separate Git directory paths (gitpython-developers/GitPython)
git/repo/base.py · Repo._clone,git/repo/fun.py · find_submodule_git_dir
Cite this entry
@misc{vaitp:cve2026110855,
title = {{Info disclosure via env‑var expansion in GitPython <3.2 during clone/submodule update.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-110855},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-110855/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
