Description
GitPython before 3.1.52 is vulnerable to environment-variable exfiltration in Repo.clone_from(). The caller-supplied remote URL is passed through Git.polish_url(), which on non-Cygwin platforms calls os.path.expandvars() on the URL before invoking git clone. An attacker who controls the clone URL can embed $NAME or ${NAME} tokens that are expanded to the values of the hosting process's environment variables (e.g., AWS_SECRET_ACCESS_KEY or GITHUB_TOKEN). The resulting URL, now containing the secret, is transmitted over the network to an attacker-controlled host during the clone attempt, disclosing the secret.
Published: 2026-08-01
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

GitPython versions prior to 3.1.52 allow an attacker who can influence the clone URL to embed environment variable expansion tokens such as $NAME or ${NAME}. When the URL is processed by Git.polish_url(), the implementation on non‑Cygwin platforms calls os.path.expandvars(), which expands these tokens to the values of environment variables in the host process. The resulting URL, now containing the expanded values, is transmitted over the network to the target repository location. If the repository host is controlled by the attacker, the expanded secrets—such as AWS_SECRET_ACCESS_KEY or GITHUB_TOKEN—are exposed remotely, leading to a confidentiality breach of sensitive credentials. The weakness is classified as CWE‑200 and CWE‑214, reflecting unauthorized disclosure of information. The vulnerability is exploited via normal clone operations; an attacker does not need elevated privileges beyond the ability to supply a malicious URL to a process executing Repo.clone_from().

Affected Systems

The affected product is GitPython, maintained by gitpython-developers. All releases earlier than version 3.1.52 are vulnerable. The issue arises on environments that are not Cygwin, as the indirect call to os.path.expandvars() occurs only in those contexts. Users of this library in CI/CD pipelines, development tools, or any scripts that perform remote repository cloning are at risk if their application permits untrusted URLs.

Risk and Exploitability

The CVSS score of 8.7 places this flaw in the high severity range. The EPSS score of 0.00266 (0.266%) indicates a low but non‑zero probability of exploitation, meaning that while attacks are unlikely, the potential impact remains high. The vulnerability is not currently listed in the CISA KEV catalog, indicating no publicly known, actively exploited instances at the time of assessment. Attackers can feasibly target systems that run GitPython in environments where environment variables contain high‑value secrets. The exploit is straightforward: supply a crafted clone URL to the vulnerable process and observe the exfiltrated secret in the outbound network connection.

Generated by OpenCVE AI on August 4, 2026 at 22:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade GitPython to version 3.1.52 or newer, which removes the use of os.path.expandvars() when processing clone URLs.
  • If an upgrade is not immediately possible, sanitize the clone URL by escaping environment variable delimiters—e.g., replace $ with \$ or use literal URLs—before passing it to Repo.clone_from().
  • Limit the environment in which GitPython runs by clearing or restricting sensitive environment variables, ensuring that even if variable expansion occurs, no valuable secrets are exposed.

Generated by OpenCVE AI on August 4, 2026 at 22:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 14 Aug 2026 17:15:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython

Tue, 04 Aug 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-214
References
Metrics threat_severity

None

threat_severity

Important


Mon, 03 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sun, 02 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython

Sat, 01 Aug 2026 12:45:00 +0000

Type Values Removed Values Added
Description GitPython before 3.1.52 is vulnerable to environment-variable exfiltration in Repo.clone_from(). The caller-supplied remote URL is passed through Git.polish_url(), which on non-Cygwin platforms calls os.path.expandvars() on the URL before invoking git clone. An attacker who controls the clone URL can embed $NAME or ${NAME} tokens that are expanded to the values of the hosting process's environment variables (e.g., AWS_SECRET_ACCESS_KEY or GITHUB_TOKEN). The resulting URL, now containing the secret, is transmitted over the network to an attacker-controlled host during the clone attempt, disclosing the secret.
Title GitPython before 3.1.52 Environment Variable Exfiltration via clone_from
Weaknesses CWE-200
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Gitpython-developers Gitpython
Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-14T16:50:51.427Z

Reserved: 2026-07-29T13:07:21.183Z

Link: CVE-2026-67322

cve-icon Vulnrichment

Updated: 2026-08-03T18:27:38.567Z

cve-icon NVD

Status : Received

Published: 2026-08-01T13:17:02.493

Modified: 2026-08-03T19:16:51.493

Link: CVE-2026-67322

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-01T12:22:17Z

Links: CVE-2026-67322 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T22:15:03Z

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-214

    Invocation of Process Using Visible Sensitive Information