Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessStage executable post-checkout hook in attacker-reachable directory
-
DeliverySupply --template path via Repo.clone_from() template argument
-
Exploit--template passes check_unsafe_options (absent from denylist)
-
ExecutionGit copies hook directory into cloned repo's .git/hooks/
-
PersistGit executes post-checkout hook at checkout time
-
ImpactArbitrary OS commands run under cloning process identity
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Two concurrent conditions are required. First, the attacker must have sufficient access to influence the |
| Impact | The CVSS 4.0 score of 7.7 with AC:H and AT:P accurately reflects the dual precondition: the attacker must both control clone arguments (PR:L) and stage a reachable hook directory. These modifiers appropriately temper what would otherwise be a near-critical impact triple (VC:H/VI:H/VA:H). EPSS data is absent from the provided intelligence - exploitation probability cannot be quantified. No CISA KEV listing is present, so mass exploitation is not confirmed. However, a live-verified POC against the latest release at disclosure (3.1.53) significantly elevates real-world risk: the barrier to weaponization is low for any application that forwards user-supplied metadata to |
| Exploit ScenarioDerived | An attacker targeting a CI/CD service backed by GitPython stages an executable |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 13, 2026
Arbitrary OS command execution in GitPython <= 3.1.53 is achievable during clone operations because the unsafe_git_clone_options denylist in base.py omits --template, allowing it to pass check_unsafe_options without error in the default allow_unsafe_options=False configuration. Callers who can influence Repo.clone_from() arguments can supply a --template path to an attacker-staged directory containing an executable post-checkout hook, which git automatically executes at checkout time. A live-verified proof-of-concept against tag 3.1.53 has been publicly disclosed; no active exploitation is confirmed in CISA KEV at time of analysis.
RemediationAI
Upgrade GitPython to version 3.1.54 or later via pip install --upgrade gitpython. Version 3.1.54 adds --template to the unsafe_git_clone_options denylist in base.py, closing the bypass. The upstream fix is in PR #2180 (https://github.com/gitpython-developers/GitPython/pull/2180) and commit ffcb5359e87619f4fe4a70a4aff5f08c5580ba97. If immediate upgrade is not possible, audit all Repo.clone_from() call sites in the application and reject or sanitize any user-supplied values that reach the template keyword argument or --template in multi_options before they are passed to GitPython - this prevents the attacker from specifying the hook-staging directory. Additionally, ensure that directories reachable by the cloning process (e.g., /tmp, upload directories, shared mounts) do not contain world-executable hook scripts; this limits the attack surface for the hook-staging precondition, though it is not a substitute for patching.
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 (pip package, CPE: cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) is a Python library wrapping git operations. The flaw resides in base.py lines 145-152, where unsafe_git_clone_options is defined as ['--upload-pack', '-u', '--config', '-c']. The --template git option is absent from this list. When git clone --template=<dir> is invoked, git copies <dir>/hooks/ into the new repository's .git/hooks/ directory and automatically executes any post-checkout hook present at checkout time - a git-native behavior that is independent of protocol.allow or GIT_ALLOW_PROTOCOL controls. The root cause maps to CWE-78 (OS Command Injection via incomplete neutralization): the denylist is the sole guard against option injection, and an omitted entry permits a hook-staging vector that git then executes with the privileges of the cloning process.
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:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
AV:N as clone targets remote URLs; AC:H for hook-staging precondition (AT:P equivalent); PR:L as caller must control clone arguments; S:C because hook execution escapes the library's own scope.
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
GitPython before 3.1.54 contains an incomplete denylist in unsafe_git_clone_options that omits --template, allowing attackers to achieve arbitrary command execution during clone operations. Attackers can supply --template pointing to a directory containing malicious post-checkout hooks that execute when git clones the repository.
Blast Radius
ecosystem impact- 4 pypi packages depend on gitpython (4 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.1.54.
Executive ViewAI
GitPython versions 3.1.53 and earlier contain an arbitrary OS command execution vulnerability in repository clone operations that could allow attackers to execute code within development and CI/CD environments. Organizations relying on GitPython face supply chain risk if their applications or build pipelines process untrusted repository cloning requests.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Validate and sanitize --template arguments in all Repo.clone_from() calls to reject or block this option; (2) Restrict template directory access to a curated whitelist of trusted paths; (3) Execute clone operations within isolated, ephemeral sandboxed environments where feasible; (4) Where possible, replace GitPython clone operations with native git commands using validated argument filtering.
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
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
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
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
GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS
Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti
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
Same weakness CWE-78 – OS Command Injection
View allSame technique Command Injection
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| 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-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 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | 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 | 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 |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-57792
GHSA-2726-phmx-rc26
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB