CVE-2026-73625
Remote code execution via crafted git options bypassing check_unsafe_options in GitPython.
- CVSS 8.7
- CWE-78
- Input Validation and Sanitization
- Remote
GitPython versions before 3.1.54 contain a remote code execution vulnerability in the check_unsafe_options guard that can be bypassed by smuggling git options inside single-character kwarg values. Attackers can supply crafted option dictionaries to clone_from, fetch, pull, push, ls_remote, iter_commits, blame, or archive methods to execute arbitrary OS commands via the –upload-pack parameter.
- CWE
- CWE-78
- CVSS base score
- 8.7
- Published
- 2026-08-13
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect 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.54 or newer.
Vulnerable code sample
import git
def clone_repo(url, dest, extra_opts):
"""
Clone a repository, allowing callers to pass arbitrary git options.
"""
# VULNERABLE: unchecked options allow command injection via --upload-pack
repo = git.Repo.clone_from(url, dest, **extra_opts)
return repoPatched code sample
import git
def clone_repo(url, dest, extra_opts):
"""
Clone a repository, sanitizing git options to prevent command injection.
"""
# FIX: reject single‑character option keys that could inject --upload-pack
safe_opts = {k: v for k, v in extra_opts.items() if len(k) > 1}
repo = git.Repo.clone_from(url, dest, **safe_opts)
return repoPublished 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: validate split short-option values (gitpython-developers/GitPython)
git/cmd.py · Git._option_candidates
Cite this entry
@misc{vaitp:cve202673625,
title = {{Remote code execution via crafted git options bypassing check_unsafe_options in GitPython.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-73625},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-73625/}}
}
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 ::
