Description
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.
Published: 2026-08-19
Score: 7.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

GitPython versions prior to 3.1.58 contain a vulnerability in the Repo.init function that forwards git options without validation. By providing a template parameter that points to a directory containing malicious git hooks, an attacker can cause those hooks to execute when subsequent git operations are performed on the initialized repository, leading to arbitrary code execution with the privileges of the running process.

Affected Systems

All versions of the GitPython library distributed by gitpython‑developers before 3.1.58 are affected. The library is commonly embedded in Python applications that interact with Git repositories. Any deployment that invokes Repo.init with a template parameter that can be influenced by untrusted input could be vulnerable.

Risk and Exploitability

The flaw has a CVSS score of 7.7, indicating high severity, but the EPSS score of < 1% suggests a very low probability of exploitation. It is not listed in the CISA KEV catalog. The attack requires the ability to control the template parameter supplied to Repo.init, which typically means the attacker can influence code that runs within the affected application; this is inferred from the description since the exact attack vector is not explicitly stated. Once a malicious template with hooks is provided, those hooks run during subsequent git commands, giving the attacker full execution rights on the host. The vulnerability could be exploited remotely by delivering a specially crafted repository or by affecting privileged code that calls Repo.init, although no known exploits are public.

Generated by OpenCVE AI on August 28, 2026 at 20:10 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update GitPython to version 3.1.58 or later, which removes the unsafe forwarding of git options.
  • If an update cannot be applied immediately, avoid passing untrusted data to the template parameter of Repo.init and ensure that any directories used for templates contain only trusted, verified hooks.
  • Validate and sanitize the template path before calling Repo.init, and consider removing or neutralizing hooks in any directories that could be exploited by an attacker.

Generated by OpenCVE AI on August 28, 2026 at 20:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-9rj7-rf2p-w77r GitPython: Unguarded git option forwarding in Repo.init enables arbitrary command execution via --template clone hooks
History

Thu, 03 Sep 2026 15:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-94
References
Metrics threat_severity

None

threat_severity

Important


Thu, 20 Aug 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 17:30:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython

Wed, 19 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 14:15:00 +0000

Type Values Removed Values Added
Description 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.
Title GitPython before 3.1.58 Remote Code Execution via Repo.init
First Time appeared Gitpython Project
Gitpython Project gitpython
Weaknesses CWE-88
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 7.7, 'vector': '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'}


Subscriptions

Gitpython-developers Gitpython
Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-20T18:39:21.389Z

Reserved: 2026-08-19T11:35:13.689Z

Link: CVE-2026-76218

cve-icon Vulnrichment

Updated: 2026-08-19T15:01:59.901Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-19T14:17:48.040

Modified: 2026-09-03T15:03:14.043

Link: CVE-2026-76218

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-19T14:02:02Z

Links: CVE-2026-76218 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-28T20:15:06Z

Weaknesses
  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')