CVE-2026-114145: GitPython submodule path validation can enable code execution
Summary
CVE-2026-114145: Attacker-controlled submodule paths can plant executable Git hooks, enabling arbitrary code execution during a later Git operation. Affects gitpython versions < 3.2.1. Fixed in 3.2.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
GitPython is a Python library in the PyPI ecosystem for interacting with Git repositories. It provides repository operations through Python, including creating and managing submodules. Applications use it to automate Git workflows and process repository data, including submodule specifications supplied by users or other external sources.
Vulnerability Detail
Attacker-controlled submodule paths can lead to arbitrary code execution when Git later runs a planted hook. In GitPython, create_submodule clones into the requested path before strict validation rejects a .git alias such as .git/hooks. The clone can place an executable post-checkout hook in the repository’s live hooks directory. The issue affects versions through 3.2.0; validation may raise an error after the filesystem has already been modified.
How To Fix
Latest published version: 3.2.1 as of 23 Oct 2026
pip install --upgrade "gitpython==3.2.1"
The newest release already contains this fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
AI-generated workaround (not vendor-documented): GitPython applications should reject submodule paths that target .git or its descendants before calling create_submodule. Accept only paths within an explicitly permitted repository subdirectory.
Documented mitigation:
create_submodule(name, path, url)
Conclusion
Upgrade GitPython to 3.2.1, the minimum fixed version. Until upgrading, reject submodule paths that target .git or its descendants before creating submodules. Review applications that accept submodule paths from untrusted sources and assess whether affected versions were used. Vulert monitors the dependencies in Pipfile.lock and alerts when a new vulnerability affects them; check an application at https://vulert.com/scanner.
See every vulnerability recorded for gitpython →
FAQ
GitPython versions through 3.2.0 are affected, including the reported 3.1.x and 3.2.0 lines.
CVE-2026-114145 can let an attacker plant an executable Git hook that runs during a later Git operation.
Upgrade GitPython to the minimum fixed version, 3.2.1.
Reject submodule paths targeting .git or its descendants before calling GitPython’s create_submodule.
Inspect Pipfile.lock for GitPython and check its resolved version. Vulert can scan a manifest or SBOM and monitor the dependency at Vulert Scanner.
References
Related vulnerabilities
Recent vulnerabilities recorded for gitpython.