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: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a Remote Code Execution flaw in the Repo.init function of GitPython releases before 3.1.58. The function forwards git options without validation, allowing an attacker to supply a template parameter that points to a directory containing malicious git hooks. When normal git operations are later performed on the initialized repository, those hooks run, executing arbitrary code with the privileges of the process that invoked the git command. This compromise can lead to total compromise of the host system.

Affected Systems

This issue affects all versions of the GitPython library distributed by the gitpython-developers before 3.1.58. The library is commonly embedded in Python applications that interact with Git repositories. Any deployment that relies on GitPython for repository initialization and uses untrusted input for the template parameter is potentially vulnerable. Projects that target 3.1.58 or newer are not affected.

Risk and Exploitability

The CVSS score of 7.7 indicates a high severity level. EPSS is not available, and the vulnerability is not listed in the CISA KEV catalog, so the current understanding of exploitation likelihood is limited. 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. Once a malicious template with hooks is provided, the hooks are executed during subsequent git commands, giving the attacker full execution rights on the host. Since the flaw is in a library, an attacker could potentially execute arbitrary code remotely by delivering a specially crafted repository or by affecting privileged code that calls Repo.init. The lack of immediate detection means the vulnerability can remain undiscovered until an exploit is used.

Generated by OpenCVE AI on August 19, 2026 at 18:19 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 is not immediately possible, 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 19, 2026 at 18:19 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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-19T15:02:13.151Z

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 : Received

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

Modified: 2026-08-19T15:18:10.590

Link: CVE-2026-76218

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-19T18:30:03Z

Weaknesses
  • CWE-88

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