All vulnerabilities

PyPI

CVE-2026-110855

GitPython: separate_git_dir leaks env vars via crafted .gitmodules submodule name

Severity
Medium 6.5
Published
27 Oct 2026
Last changed
27 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.2.0
Exploit chance
0.3% in the next 30 daysHigher than 21% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Information exposure (CWE-200)
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Read data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Also known as
GHSA-fx3j-rwgx-fr94
Sources
OSV.dev and GitHub

Description

Repo._clone()'s handling of separate_git_dir never disables Git.polish_url()'s environment-variable expansion, unlike every other caller of that helper that handles attacker-influenced data. Since separate_git_dir can be derived from an attacker-controlled .gitmodules submodule name, a completely ordinary clone + submodule_update(init=True, recursive=True) on a malicious repository expands an environment variable of the attacker's choosing and exposes its value both as a persistent on-disk directory name and, whenever DEBUG-level logging is enabled (a common CI/verbose-logging configuration), in a Popen(...) log line that is not redacted the way credential-bearing arguments are.

git/repo/base.py's _clone() has:

This is the only remaining Git.polish_url() call site handling attacker-influenced data that does not pass expand_vars=False (there is one other unguarded call site, clone_path at line 1537, but its input is the caller's own local destination path, not attacker-controlled).

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
gitpythonPyPI · osv:PyPI:gitpython
  • Every version before 3.2.0

About gitpython

Weekly downloads (PyPI)
34,365,891PyPI Stats, 23 Nov 2026

References