Insertion of Sensitive Information Into Sent Data Affecting gitpython package, versions [,3.1.52)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-GITPYTHON-18170131
  • published22 Jul 2026
  • disclosed21 Jul 2026
  • creditKrisKennawayDD

Introduced: 21 Jul 2026

New CVE NOT AVAILABLE CWE-201  (opens in a new tab)

How to fix?

Upgrade GitPython to version 3.1.52 or higher.

Overview

GitPython is a python library used to interact with Git repositories

Affected versions of this package are vulnerable to Insertion of Sensitive Information Into Sent Data via Git.polish_url() in Repo.clone_from() and the stored-origin normalization path in git/repo/base.py. An attacker can make the server send secrets to an attacker-controlled host by supplying a clone URL containing $NAME, ${NAME}, or %NAME% tokens. Repo.clone_from() passes the attacker-controlled URL through Git.polish_url() before invoking git clone, so the process environment is expanded into the remote URL on native and Cygwin platforms. That exposes values such as API tokens or cloud credentials in the outbound request, causing secret leakage whenever an application accepts untrusted repository URLs.

Notes

  • The issue is exploitable in the common “import repository from URL” pattern, where a server-side service accepts a user-supplied clone URL and runs Repo.clone_from() under its own environment; the leaked values come from that process environment, so secrets like deployment tokens or cloud credentials can be disclosed without any separate secret-management misconfiguration.
  • The stored-origin path is also in scope: after a successful clone, GitPython persists the normalized remote URL back into the repository config, so a URL containing expansion tokens can leave the secret embedded in the saved origin metadata as well as in the outbound clone request.

CVSS Base Scores

version 4.0
version 3.1