CVE-2026-76218
PoC massArgument injection RCE in GitPython Repo.init
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.
| gitpython project GitPython | All versions before 3.1.58 (pip ecosystem; fixed in 3.1.58) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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 news0 stories
No ingested article mentions this CVE yet.