Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GitPython: Arbitrary Git Repository Creation Outside the Working Tree via Unvalidated .gitmodules Submodule Name in GitPython

0
High
Published: 08/07/2026 (08/07/2026, 15:45:39 UTC)
Source: GCVE Database
Product: GitPython

Description

GitPython versions prior to 3.1.58 contain a vulnerability where an attacker-controlled submodule name in a cloned repository's .gitmodules file can cause GitPython to create and initialize a Git repository outside the intended working directory. This occurs because GitPython does not validate the submodule name, allowing directory traversal sequences that lead to repository creation at arbitrary filesystem paths during submodule initialization.

CVSS v3.1

Score 8.2high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
None
Integrity
High
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:L

Affected software

PyPIghsa
GitPython
Affected versions
<3.1.58

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/08/2026, 15:41:27 UTC

Technical Analysis

GitPython computes the on-disk location of a submodule's separate Git directory based on the submodule name from the .gitmodules file without validation. An attacker can craft a malicious repository with a submodule name containing directory traversal sequences (e.g., ../../../../some/path) that cause GitPython to create and initialize a full Git repository outside the intended clone directory when submodules are initialized via sm.update(init=True). This vulnerability arises because GitPython's implementation does not normalize or validate the submodule name, unlike core Git which blocks this attack class (CVE-2018-11235). The vulnerability affects GitPython versions before 3.1.58 and requires the victim to clone and initialize submodules from a malicious repository.

Potential Impact

An attacker who controls a repository that a victim clones and initializes submodules for using GitPython can cause arbitrary creation and initialization of Git repositories at attacker-chosen filesystem paths outside the intended working directory. This can lead to unauthorized file system modifications and potential interference with other repositories or system files. The vulnerability does not directly disclose data or escalate privileges but allows integrity impact by creating repositories in unintended locations.

Mitigation Recommendations

A patch is available in GitPython version 3.1.58 that addresses this vulnerability by validating submodule names to prevent directory traversal. Users should upgrade to GitPython 3.1.58 or later. Until upgraded, avoid cloning and initializing submodules from untrusted repositories using GitPython. Core Git itself is not affected as it already blocks this attack class. No additional mitigations are indicated by the vendor advisory.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-hmq2-w58f-27jc
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a774331bf8831d539b463ea

Added to database: 08/08/2026, 14:54:41 UTC

Last enriched: 08/08/2026, 15:41:27 UTC

Last updated: 08/08/2026, 22:12:39 UTC

Views: 9

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses