Repo.init enables arbitrary command execution · GitPython: Unguarded git option forwarding
Affects legitSource GCVE Database
Not known to be exploited · CVSS 7.7 High : upgrade to 1.2.0.post0_14 soon.
Data as of 26 Oct 2026, 19:01 UTC
- Patch
- Available – fixed in 1.2.0.post0_14
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 19 Aug 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade legit to 1.2.0.post0_14.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewlegitpkg:brew/legitOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in GitPython version 1.2.0.post0_14 that adds a check_unsafe_options guard to Repo.init, blocking unsafe options such as --template and --separate-git-dir. Users should upgrade to this fixed version or later to mitigate the vulnerability. No other mitigation is required as the vulnerability is addressed by this official fix.
Description
GitPython's Repo.init method forwards keyword arguments directly to git init without guarding unsafe options like --template. This allows an attacker who can control the template argument and stage a malicious hooks directory to plant executable git hooks in the new repository. These hooks execute arbitrary code on the next git operation performed by the host process. The vulnerability affects GitPython versions prior to 1.2.0.post0_14 and requires attacker control over the template path and the ability to stage executable hooks. A fix is available in version 1.2.0.post0_14 that adds checks to block unsafe options.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-9rj7-rf2p-w77r (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-76218 (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2204 (opens in a new tab)
- github.com/gitpython-developers/GitPython/commit/d9ddb55bdc66 (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.1.58 (opens in a new tab)
- vulncheck.com/advisories/gitpython-before-remote-code-execution-via-repo-init (opens in a new tab)