Skip to main content

GitPython CVE-2026-76218

| EUVDEUVD-2026-62459 HIGH
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (CWE-88)
7.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker stages executable hook at controlled path
  2. Delivery
    Authenticated attacker submits template path as application input
  3. Exploit
    Application passes template kwarg to Repo.init() unguarded
  4. Execution
    git init --template copies hook into .git/hooks/
  5. Persist
    Next git operation triggers hook execution
  6. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

GitPython 0 <3.1.58

Affected Packages

pypi gitpython fix: 3.1.58

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

Vendor (VulnCheck) PRIMARY 7.7 HIGH
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
vuln.today AI 7.5 HIGH

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.

3.1 AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Red Hat 7.5 HIGH

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 19, 2026 - 15:17 EUVD
CVE Published
Aug 19, 2026 - 14:02 cve.org
HIGH 7.7

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 16 pypi packages depend on gitpython (15 direct, 1 indirect)

Ecosystem-wide dependent count for version 3.1.58.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.5%
Top 60% exploitable
Prevalence
Medium
widely used Python git library, common in CI/CD tooling
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2022-24439 CRITICAL POC
9.8 Dec 06

All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w

CVE-2026-78676 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config

CVE-2026-78677 HIGH POC
8.7 Aug 25

Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th

CVE-2026-78675 HIGH POC
8.6 Aug 25

GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont

CVE-2023-40590 HIGH POC
7.8 Aug 28

GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability

CVE-2026-78679 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s

CVE-2026-78678 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a

CVE-2023-41040 MEDIUM POC
6.5 Aug 30

GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili

CVE-2023-40267 CRITICAL
9.8 Aug 11

GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS

CVE-2026-67324 CRITICAL
9.3 Aug 01

Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti

CVE-2026-67325 HIGH POC
8.7 Aug 01

Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl

CVE-2026-42215 HIGH POC
8.8 May 07

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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy