OS Command Injection in GitPython - CVE-2026-42215
Published: April 27, 2026 / Updated: May 11, 2026
Vulnerability details
The vulnerability allows a remote user to execute arbitrary code.
The vulnerability exists due to command injection in Repo.clone_from(), Remote.fetch(), Remote.pull(), and Remote.push() when processing attacker-controlled kwargs that are normalized into unsafe Git options. A remote user can supply crafted upload_pack or receive_pack values to execute arbitrary code.
The issue occurs because underscore-form kwargs bypass the unsafe-option check before being converted into dangerous command-line flags, and it does not require a malicious repository.
Affected software
Fedora
Ubuntu
openEuler
python-git (Ubuntu package)
python3-GitPython
python-GitPython-help
python-GitPython
GitPython
How to mitigate CVE-2026-42215
python-git (Ubuntu package) - addressed in versions 0.3.2~RC1-3ubuntu0.1~esm3, 1.0.1+git137-gc8b8379-2.1ubuntu0.1~esm4, 2.1.8-1ubuntu0.1~esm4, 3.0.7-1ubuntu0.1~esm4, 3.1.24-1ubuntu0.1~esm3, 3.1.37-3ubuntu0.1~esm2, 3.1.46-1ubuntu0.1~esm1
python3-GitPython - update to 3.1.49-1
python-GitPython-help - update to 3.1.49-1
python-GitPython - update to 3.1.49-1
GitPython - addressed in versions 3.1.50-1.el9, 3.1.50-1.el10_1, 3.1.50-1.el10_3, 3.1.50-1.fc42, 3.1.50-1.fc43, 3.1.50-1.fc44
External References
Related Security Bulletins
- Multiple vulnerabilities in GitPython
- Fedora 44 update for GitPython
- Fedora 43 update for GitPython
- Fedora 42 update for GitPython
- Fedora EPEL 10.3 update for GitPython
- Fedora EPEL 10.1 update for GitPython
- Fedora EPEL 9 update for GitPython
- openEuler 24.03 LTS SP3 update for python-GitPython
- openEuler 24.03 LTS SP1 update for python-GitPython
- openEuler 24.03 LTS update for python-GitPython
- Ubuntu update for python-git