CVE-2026-73623
Incomplete denylist lets –template run malicious post‑checkout hooks in GitPython.
- CVSS 7.7
- CWE-78
- Input Validation and Sanitization
- Remote
GitPython before 3.1.54 contains an incomplete denylist in unsafe_git_clone_options that omits –template, allowing attackers to achieve arbitrary command execution during clone operations. Attackers can supply –template pointing to a directory containing malicious post-checkout hooks that execute when git clones the repository.
- CWE
- CWE-78
- CVSS base score
- 7.7
- Published
- 2026-08-13
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- GitPython
- Fixed by upgrading
- Yes
Solution
Upgrade GitPython to version 3.1.55 or later.
Vulnerable code sample
import git
def clone_repo(url: str, dest: str, extra_opts: list[str] | None = None) -> git.Repo:
"""
Clone a remote repository, allowing caller‑supplied git options.
"""
opts = extra_opts or []
# VULNERABLE: user‑controlled '--template' option is passed directly to git clone
return git.Repo.clone_from(url, dest, multi_options=opts)Patched code sample
import git
def clone_repo(url: str, dest: str, extra_opts: list[str] | None = None) -> git.Repo:
"""
Clone a remote repository, rejecting unsafe '--template' option.
"""
raw_opts = extra_opts or []
# FIX: strip any '--template' option to prevent command injection
safe_opts = [opt for opt in raw_opts if not opt.startswith('--template')]
return git.Repo.clone_from(url, dest, multi_options=safe_opts)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: reject unsafe clone templates (gitpython-developers/GitPython)
git/repo/base.py
Cite this entry
@misc{vaitp:cve202673623,
title = {{Incomplete denylist lets --template run malicious post‑checkout hooks in GitPython.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-73623},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-73623/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
