ZeroHour

CVE-2026-76218

PoC mass

Argument injection RCE in GitPython Repo.init

CVSS 4.0
7.7 high
EPSS
<1%p52
Published
()
Modified
AI analysis

GitPython before 3.1.58 contains a remote code execution vulnerability in its Repo.init function, which forwards caller-supplied options to the underlying git command without validating them (CWE-88 argument injection). An attacker who can influence the arguments passed to Repo.init — typically when an application builds those options from untrusted input — can set the template parameter to a directory containing a malicious git hooks tree, and those hooks execute arbitrary commands when git operations are later performed on the initialized repository. Successful exploitation yields arbitrary code execution on the host running GitPython, with high impact on the confidentiality, integrity, and availability of that system. Any application using the pip-installed GitPython library prior to 3.1.58 in which an attacker can control Repo.init options (such as template) is affected; deployments that pass only fixed, trusted arguments face low risk. A public proof of concept is referenced in the project's GitHub security advisory (GHSA-9rj7-rf2p-w77r), but there are no confirmed in-the-wild attacks, the flaw is not in CISA KEV, and EPSS puts the 30-day exploitation probability at just 0.7%.

What to do: Upgrade GitPython to 3.1.58 or later via pip. In the meantime, audit your code and dependencies for calls to Repo.init where options such as template originate from untrusted input, and restrict the template parameter to fixed, trusted paths that an attacker cannot populate with a crafted hooks directory.

Affected
gitpython project GitPythonAll versions before 3.1.58 (pip ecosystem; fixed in 3.1.58)
Estimated exposure
mass≈tens of millions of pip installs (one of PyPI's most-downloaded libraries), though the practically exploitable subset — deployments calling Repo.init with… — GitPython is a ubiquitous Python package with tens of millions of PyPI downloads per month and broad use in CI/CD and git automation, but exploitation additionally requires an application to pass attacker-influenced arguments (e.g.,…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

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.

Vendors
gitpython project
Products
gitpython
Ecosystems
pip
Weakness
CWE-88
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-9rj7-rf2p-w77r (high)

In the news

No ingested article mentions this CVE yet.