CVE-2026-114145: GitPython validates a submodule's ".git" path only after cloning into it (RCE)
create_submodule(name, path, url) clones a submodule into the repo’s own .git
directory before it rejects the path. A path of “.git/hooks” is accepted by the
pre-clone check, so the submodule is cloned straight into the live hooks directory,
and a file named post-checkout in the submodule becomes an executable
.git/hooks/post-checkout. On 3.2.0+ the later index check does raise ValueError,
but only after the clone already wrote to disk, and it does not remove the planted
hook; on 3.1.x there is no such check and the call succeeds silently. Either way the
hook runs on the next git operation (e.g. checkout), giving code execution.
References
- github.com/advisories/GHSA-83vg-56qc-22m7
- github.com/gitpython-developers/GitPython/commit/97eadb888d2f99567e3113f4e455be4ca128f697
- github.com/gitpython-developers/GitPython/pull/2264
- github.com/gitpython-developers/GitPython/releases/tag/3.2.1
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-83vg-56qc-22m7
- nvd.nist.gov/vuln/detail/CVE-2026-114145
Code Behaviors & Features
Detect and mitigate CVE-2026-114145 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →