Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker stages executable hook at controlled path
-
DeliveryAuthenticated attacker submits template path as application input
-
ExploitApplication passes template kwarg to Repo.init() unguarded
-
Executiongit init --template copies hook into .git/hooks/
-
PersistNext git operation triggers hook execution
-
ImpactArbitrary code runs as host process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Argument sanitization
|
| Exploitation Conditions | Two specific preconditions must both be satisfied: first, the application must invoke Repo.init() with a template kwarg whose value is attacker-influenced - this requires either direct user input reaching the kwarg or indirect control through configuration, job parameters, or repository metadata. Second, the attacker must have an executable hook file (e.g., post-commit) staged at a filesystem path that the git process can read, meaning the attacker needs either write access to the target host's filesystem or the ability to reference a network-mounted or shared path. Exploitation is further limited by PR:L - the attacker must be an authenticated or at-minimum low-privileged user of the application, not a fully anonymous external party. A git operation (commit, merge, etc.) on the initialized repository must occur after initialization to trigger the hook. Default GitPython installations are NOT vulnerable unless the application explicitly forwards user-supplied values to the template kwarg; applications that call Repo.init() with only hardcoded or validated arguments are not affected. |
| Impact | The CVSS 4.0 score of 7.7 (AV:N/AC:H/AT:P/PR:L) correctly reflects meaningful exploitation barriers: the attacker must supply a controlled template kwarg (requiring some degree of influence over application behavior) AND must have an executable hook directory staged at a reachable path. These two preconditions together justify AC:H and AT:P. Despite those barriers, the availability of a working, independently reproduced proof-of-concept published in the GHSA advisory substantially lowers the practical effort required once preconditions are met. EPSS data was not provided; KEV status is not confirmed. Because exploitation depends on the application forwarding attacker-influenced kwargs to Repo.init(), risk is concentrated in applications that accept user-supplied repository parameters - CI/CD pipelines, code-review automation, and repository hosting platforms are the highest-exposure deployment profiles. No CISA KEV confirmation is present in the input data, so active exploitation in the wild is unconfirmed. The missing EPSS score is a gap; absent that signal, the combination of PR:L authentication requirement and a publicly demonstrated exploit chain suggests this should be treated with urgency by any team running GitPython in a multi-tenant or externally-facing context. |
| Exploit ScenarioDerived | A developer platform or CI/CD service uses GitPython to initialize repositories from user-submitted job configurations, and a user-controlled field (e.g., a template path parameter) is passed as a kwarg to Repo.init(). An attacker submits a job pointing template at a pre-staged directory containing a malicious post-commit hook script; GitPython calls git init --template=/attacker/path, git copies the hook into the new repo's .git/hooks/, and the next automated git commit in the pipeline executes the hook as the CI service account. A working proof-of-concept demonstrating exactly this chain was published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Remote code execution in GitPython before 3.1.58 is reachable through Repo.init(), which forwards all keyword arguments verbatim to git init without any unsafe-option validation. An attacker who can influence the template kwarg can point it at an attacker-controlled directory containing malicious git hooks; git copies those hooks into the newly initialized repository, and the next git operation (e.g., a commit) triggers arbitrary code execution at the privilege level of the host process. A proof-of-concept demonstrating the full hook-copy-and-fire chain has been publicly released and independently reproduced per the GHSA advisory, and upstream fix code is available in PR #2204 and commit d9ddb55bdc66, targeting the 3.1.58 release.
RemediationAI
Upgrade GitPython to version 3.1.58 or later; this is the primary fix, resolving the missing unsafe-option guard in Repo.init(). The upstream fix is tracked in pull request https://github.com/gitpython-developers/GitPython/pull/2204 and commit d9ddb55bdc66. If an immediate upgrade is not possible, applications should audit all call sites of Repo.init() and ensure no externally-supplied data reaches the template or separate_git_dir keyword arguments; removing those kwargs from any call path that processes user input eliminates the exploitable condition without requiring a library update. A secondary compensating control is to sandbox the host process (e.g., run in a container with a read-only filesystem or with seccomp/AppArmor profiles) to limit what an executed hook can accomplish, but this does not prevent hook execution itself. The VulnCheck advisory is also available at https://www.vulncheck.com/advisories/gitpython-before-remote-code-execution-via-repo-init.
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 library (pip package GitPython, CPE cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) that wraps git CLI invocations. The vulnerable sink is Repo.init() in git/repo/base.py:1435, which passes **kwargs directly to git init with no check_unsafe_options gate and no allow_unsafe_options parameter - in contrast to the clone path, which already guards against --template via the unsafe_git_clone_options denylist (see GHSA-6p8h-3wgx-97gf). The root cause is CWE-88 (Improper Neutralization of Argument Delimiters in a Command), specifically the unfiltered forwarding of the --template option. Git's --template mechanism copies all files from the specified directory into the .git/hooks directory of the initialized repo; if any copied file is executable and matches a git hook name (e.g., post-commit), git will execute it automatically on the next matching operation. A parallel vector through the same unguarded sink is --separate-git-dir.
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
Network vector because the trigger path is remote application input; AC:H and PR:L because two preconditions (kwarg influence plus staged hook path) require low-privilege app access but non-trivial setup.
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.58 contains a remote code execution vulnerability in Repo.init that forwards unsafe git options without validation. Attackers can supply a template parameter pointing to a directory with malicious git hooks that execute arbitrary code when git operations are performed on the initialized repository.
Blast Radius
ecosystem impact- 16 pypi packages depend on gitpython (15 direct, 1 indirect)
Ecosystem-wide dependent count for version 3.1.58.
Executive ViewAI
Remote code execution vulnerability in GitPython (CVE-2026-76218, CVSS 7.7) with publicly available exploit code enables attackers to execute arbitrary code when applications initialize git repositories with attacker-controlled template parameters. Organizations using GitPython for repository automation, CI/CD, or services accepting repository initialization inputs face immediate compromise risk. Without a released vendor patch, urgent remediation through version constraints and input validation is required.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation-reject any user-supplied template parameters in Repo.init() calls; (2) Use only pre-configured, trusted repository templates from internal stores; (3) Restrict Repo.init() execution to administrative functions only, preventing exposure through user-facing APIs; (4) Isolate systems running GitPython from untrusted network sources and monitor for exploitation attempts; (5) Review and version-pin GitPython in dependency management until upgrade is feasible.
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
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
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
Vendor 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-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-62459
GHSA-298h-jpq4-m665
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB