Impact
GitPython versions before 3.1.58 do not validate the names of submodules defined in a .gitmodules file. A malicious repository can embed traversal sequences such as '../' in a submodule name, which GitPython will process during submodule initialization. The result is that GitPython creates a new Git repository at a path outside the intended clone directory, allowing an attacker to write or modify files wherever the process has permission. This flaw can be used to place files that may be executed later, potentially leading to unauthorized code execution or persistence.
Affected Systems
The vulnerability affects the GitPython library developed by the GitPython developers. All releases earlier than 3.1.58 are impacted. Any application that uses GitPython to clone or initialize submodules from untrusted repositories is exposed.
Risk and Exploitability
The CVSS score of 8.4 marks the flaw as high severity. The EPSS score of < 1% indicates a very low likelihood of public exploitation, and the vulnerability is not listed in the CISA KEV catalog. Attackers can deliver a crafted .gitmodules file to a system where GitPython runs, causing the library to initialize submodules and create repositories at arbitrary filesystem locations. The likely attack vector is remote when the library is used in services that process untrusted repository data, but the absence of a high EPSS suggests that exploitation has not been widely observed.
OpenCVE Enrichment
Github GHSA