Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft repo with submodule path .git/hooks
-
DeliveryVictim app passes untrusted path to create_submodule()
-
Exploit_clone_repo() clones into hooks directory
-
ExecutionExecutable post-checkout hook written to disk
-
PersistLater Git checkout operation runs hook
-
ImpactArbitrary code execution in victim context
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incorrect behavior order
|
| Exploitation Conditions | Requires an application that passes an attacker-influenced submodule path (e.g. .git/hooks) into GitPython's create_submodule(), AND a clone destination empty enough for Git to clone into it - in practice meaning the default sample hooks are absent from .git/hooks. Exploitation further requires a later Git operation to perform a checkout so the planted post-checkout hook executes (UI:R). Limiting factors: the attack is gated by this non-default application behavior (accepting untrusted submodule paths) and the empty-hooks state, making it unsuitable against applications that validate submodule paths or against repos with standard sample hooks present; it is network-reachable and needs no attacker authentication (PR:N) against affected versions 3.1.x through 3.2.0-affected revisions, fixed in 3.2.1. |
| Impact | The CVSS 3.1 base score of 7.5 (HIGH) is driven by AV:N, PR:N and full C:H/I:H/A:H impact reflecting arbitrary code execution via a planted Git hook, but two metrics materially temper real-world risk: AC:H (the destination such as .git/hooks must be empty enough for Git to clone into it, which requires default sample hooks to be absent) and UI:R (a later Git operation must run to trigger the post-checkout hook). No EPSS score, KEV listing, or POC indicator was provided in the input, so there is no public exploit identified at time of analysis and no evidence of active exploitation - exploitation status is unproven, not disproven. SSVC-style reading: exploitation=none observed, technical impact=total (code execution), but automatable=likely NO because the attack depends on an application deliberately feeding untrusted submodule paths into create_submodule() plus a specific empty-hooks precondition. Net assessment: this is a legitimately serious code-execution bug in a popular library, but it is a conditional, usage-dependent issue rather than a broadly wormable internet-facing flaw - prioritize for applications that process untrusted repositories/submodules, de-prioritize elsewhere. The 'Information Disclosure' tag conflicts with the actual impact (code execution via hook), and the absence of EPSS/KEV/POC signals should be read as missing data, not as confirmation of low risk. |
| Exploit ScenarioDerived | An attacker publishes or submits a malicious repository whose submodule configuration points the submodule path at .git/hooks, then induces a victim application that uses GitPython's create_submodule() to process it. Because _clone_repo() runs before the destination is safely rejected, Git clones attacker content into the hooks directory, planting an executable post-checkout hook that runs the next time a Git operation performs a checkout - yielding code execution in the victim's context. No public exploit was identified at time of analysis, and the high attack complexity (an empty .git/hooks with default sample hooks absent) plus required follow-on Git operation limit reliable exploitation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 21, 2026
Improperly ordered path validation in GitPython before 3.2.1 enables unauthenticated remote attackers who can influence a submodule path to make create_submodule() clone an attacker-controlled repository into a Git metadata location such as .git/hooks, planting a post-checkout hook that executes arbitrary code when a later checkout occurs. The CVSS 3.1 score of 7.5 (HIGH) is materially tempered by AC:H-the hooks directory must be empty enough for Git to clone into, typically requiring default sample hooks to be absent-and UI:R, since a subsequent Git operation must trigger the hook. No public exploit identified at time of analysis; affected code spans 3.1.x through 3.2.0-affected revisions and is fixed in 3.2.1.
RemediationAI
Vendor-released patch: 3.2.1. Upgrade GitPython to 3.2.1 or later from https://github.com/gitpython-developers/GitPython/releases/tag/3.2.1; the fix is tracked in advisory GHSA-83vg-56qc-22m7 (https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-83vg-56qc-22m7), commit 97eadb888d2f99567e3113f4e455be4ca128f697, and PR 2264. If upgrade is delayed, do not pass untrusted or user-supplied submodule paths into create_submodule(); enforce an application-side allowlist and reject paths that contain .git components or resolve inside the repository's .git directory, understanding this only protects callers you control. As a compensating control, run Git with core.hooksPath set to an empty directory or /dev/null to block post-checkout hook execution, but this disables all hooks including legitimate automation; alternatively keep .git/hooks populated with sample hooks so a clone into it fails, though this is brittle and does not address other git_dir aliases. Remove any unexpected files from .git/hooks after a failed or suspicious submodule operation.
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 is a Python interface to Git; its create_submodule() API constructs submodule configuration and calls _clone_repo() to populate a checkout path under the parent working tree. The root cause is CWE-696 (Incorrect Behavior Order): the destination path is validated only after the clone has written files, so a path that resolves to .git/hooks can receive a repository whose contents include an executable post-checkout hook. In 3.1.x the _validate_repo_path() guard is absent and the clone proceeds silently; in 3.2.0 and later affected revisions a check in git/index/base.py raises ValueError after disk writes and leaves the planted file behind. The 3.2.1 fix (commit 97eadb888d2f99567e3113f4e455be4ca128f697, PR 2264) moves path validation before _clone_repo(), rejects submodule checkout paths that alias the repository's git_dir/common_dir, adds Windows reserved-name/path checks, rejects nested Git directories, and cleans up a partial clone when post-clone validation fails. The assessed AV:N/AC:H/PR:N/UI:R vector reflects that exploitation is network-reachable without authentication but gated by application behavior and the empty-hooks precondition, with a later checkout required for hook execution.
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
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
AC:H because exploitation needs an empty .git/hooks (sample hooks absent) plus an app accepting untrusted submodule paths; PR:N unauthenticated; UI:R for the triggering Git operation; C/I/A:H via code execution through the planted hook.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
GitPython is a python library used to interact with Git repositories. Prior to 3.2.1, create_submodule() in git/objects/submodule/base.py accepts an attacker-influenced submodule path such as .git/hooks and invokes _clone_repo() before safely rejecting the destination. In 3.1.x, _validate_repo_path() does not exist and the call succeeds silently, while in 3.2.0 and later affected revisions the check in git/index/base.py raises ValueError only after the clone has written to disk and does not remove the planted file. An attacker-controlled submodule can therefore place an executable post-checkout hook that a later Git operation executes. Exploitation requires an application to accept an untrusted submodule path and a clone destination such as .git/hooks that is empty enough for Git to clone into it, which commonly means that default sample hooks are absent. This issue is fixed in version 3.2.1.
Blast Radius
ecosystem impact- 9,264 pypi packages depend on gitpython (4,510 direct, 4,854 indirect)
Ecosystem-wide dependent count for version 3.2.1.
Technical POC Analysis
CWE-696, Incorrect Behavior Order - validation runs after mutation.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
GitPython releases before 3.2.1 contain a high-severity path-ordering weakness that can redirect submodule cloning into Git metadata and plant a hook for later code execution. The exposure is concentrated in engineering workflows and CI/CD systems that call create_submodule() with externally influenced submodule paths, where a successful attack could compromise build integrity and developer environments. No public exploit was identified at time of analysis, but leadership should prioritize inventory and upgrade because the potential impact is arbitrary code execution.
Apply vendor patch (GitPython 3.2.1).
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 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
Environment variable exfiltration in GitPython before 3.1.52 allows any attacker who controls a URL passed to `Repo.clon
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
EUVD-2026-107557
GHSA-83vg-56qc-22m7
NVD
CVE.org
EPSS
VulDB
Exploit-DB