Pypi · Gitpython · CVE-2026-67322
**Name of the Vulnerable Software and Affected Versions**
GitPython versions prior to 3.1.52
**Description**
GitPython is susceptible to environment-variable exfiltration when using the `Repo.clone from()` function. The issue occurs because the remote URL provided by the user is processed by the `Git.polish url()` function, which invokes `os.path.expandvars()` on non-Cygwin platforms before executing the `git clone` command. An attacker who can control the clone URL can include tokens such as `$NAME` or `${NAME}`, which the server expands into the actual values of the process's environment variables (for example, `AWS SECRET ACCESS KEY` or `GITHUB TOKEN`). These secrets are then transmitted over the network to an attacker-controlled host during the clone attempt. Additionally, this behavior can be used to bypass the `check unsafe protocols()` filter by expanding a variable into an unsafe protocol like `ext::` after the initial security check has been performed.
**Recommendations**
Update GitPython to version 3.1.52 or later.
As a temporary mitigation, avoid passing untrusted or user-supplied URLs to the `Repo.clone from()` function.