Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify service accepting user-supplied clone URLs
-
DeliveryCraft URL embedding $ENV_VAR tokens
-
ExploitSubmit malicious URL to target service
-
ExecutionServer invokes polish_url() calling os.path.expandvars()
-
Persistgit clone transmits expanded secret to attacker host
-
ImpactAttacker captures secret from server logs
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK
2 techniques across 2 tactics: Collection, Discovery The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target application calls |
| Impact | The CVSS 4.0 score of 8.7 with vector AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N accurately reflects the real-world risk profile: the attack requires no authentication, no special conditions, no user interaction, and produces high confidentiality impact. The exploitable surface is any application or service that accepts a user-supplied URL and passes it to |
| Exploit ScenarioDerived | An attacker targeting a CI/CD platform or git-hosting mirror that accepts user-submitted repository URLs crafts a URL such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 01, 2026
Environment variable exfiltration in GitPython before 3.1.52 allows any attacker who controls a URL passed to Repo.clone_from() to steal secrets from the hosting process's environment. The Git.polish_url() method unconditionally calls os.path.expandvars() on caller-supplied URLs on all non-Cygwin platforms, expanding tokens like $AWS_SECRET_ACCESS_KEY or ${GITHUB_TOKEN} before passing the resulting URL to a git clone subprocess - transmitting the expanded secret over the network to an attacker-controlled host. No public exploit code or CISA KEV listing has been identified at time of analysis, but the attack is trivial to weaponize against CI servers, git-hosting mirrors, and dependency scanners that accept user-supplied repository URLs.
RemediationAI
Upgrade gitpython to version 3.1.52 or later using pip install --upgrade gitpython. The fix is delivered via upstream PR #2172 (https://github.com/gitpython-developers/GitPython/pull/2172) and commit 8ac5a30519b6f4af85398b9b9d7064ff4d452da2; version 3.1.52 is confirmed as the patched release per package advisory data. If an immediate upgrade is not possible, the primary compensating control is to sanitize or reject any URL containing $ or % characters before passing it to Repo.clone_from() - note that this may break legitimate URLs with percent-encoded characters and should be implemented carefully with allowlist logic rather than a simple character block. A secondary option is to clear sensitive environment variables (e.g., os.environ.pop('AWS_SECRET_ACCESS_KEY', None)) in the process before calling clone_from(), but this risks breaking other functionality that depends on those variables. Neither workaround is a substitute for patching. The vendor advisory is at https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-rwj8-pgh3-r573.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GitPython (PyPI: gitpython, CPE: cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) is a Python library providing a high-level interface to Git repositories. The vulnerability originates in Git.polish_url() (git/cmd.py, line 921, v3.1.50) which unconditionally invokes Python's os.path.expandvars() on the input URL on every non-Cygwin platform. This function replaces $NAME and ${NAME} shell-variable tokens with their values from the current process environment. Because Repo._clone() - the backend for both the public Repo.clone_from() and Repo.clone() - runs the unsafe-protocol check on the *raw* URL and then passes the *post-expansion* polished URL to the git clone subprocess, the secret is embedded in the URL before the network connection is made. The root cause class is CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor): a trust boundary violation where untrusted input (the caller-supplied URL) is able to read and then transmit trusted data (process environment variables) to an attacker-controlled destination.
Know when Gitpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-exploitable via attacker-supplied URL; no privileges, authentication, or interaction required; high confidentiality loss from env var exfiltration; no integrity or availability impact.
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 6 pypi packages depend on gitpython (6 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.1.52.
Executive ViewAI
GitPython versions prior to 3.1.52 exfiltrate environment variables containing production secrets (AWS credentials, GitHub tokens, etc.) when processing attacker-controlled repository URLs, exposing CI/CD pipelines and automation platforms to credential compromise. Any organization using GitPython to clone repositories faces risk of unauthorized access to cloud infrastructure and source code repositories. A vendor-released patch is available and requires immediate deployment.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w
Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config
Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl
Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und
Command injection and arbitrary file overwrite in GitPython before 3.1.51 expose applications that pass attacker-control
Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th
GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont
GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability
Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s
Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a
GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili
Argument injection in GitPython's clone helpers lets an attacker-controlled multi_options string slip past the unsafe-op
Same weakness CWE-200 – Information Exposure
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-51855
GHSA-m4f3-g4cq-hqrx
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB