GitPython Unsafe Option Handling in Clone Operations Vulnerability

Vulnerability

A vulnerability exists in GitPython versions prior to 3.1.47, where the '_clone()' method improperly validates 'multi_options' before executing 'shlex.split' to parse them. This flaw allows an attacker to inject Git configuration options, which are then executed during the cloning process. Specifically, by crafting a string that appears safe but is transformed into multiple tokens, an attacker can manipulate Git's behavior by executing malicious hooks. The issue has been addressed in GitPython version 3.1.47.

Impact

Exploitation of this vulnerability allows for the execution of arbitrary code by manipulating Git hooks, similar to the impact described in CVE-2023-40267.

Reproduction

The vulnerability can be reproduced by using the 'Repo.clone_from' method with a 'multi_options' parameter that includes Git configuration options. After the clone operation, the injected hooks will be executed, demonstrating the successful exploitation of the vulnerability.

Remediation

Users should upgrade to GitPython version 3.1.47 or later.

Added: May 7, 2026, 7:37 PM
Updated: May 7, 2026, 7:37 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
7.5
exploitability
6.0
remediation
7.7
relevance
7.7
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.