CVE Catalog

CVE-2026-42284

High
Published: Translated: NVD NIST

Summary

GitPython is a Python library used to interact with Git repositories. In versions prior to 3.1.47, the _clone() function improperly validates multi_options, allowing malicious hooks to be executed during repository cloning.

Risk Assessment

An attacker can exploit this vulnerability to inject malicious code in the form of hooks, potentially leading to unauthorized access or execution of harmful operations on the system.

Recommendation

It is recommended to update GitPython to version 3.1.47 or later to mitigate this vulnerability.

Other vulnerabilities in GitPython

See all
Original NVD description (English source)

GitPython is a python library used to interact with Git repositories. Prior to version 3.1.47, _clone() validates multi_options as the original list, then executes shlex.split(" ".join(multi_options)). A string like "--branch main --config core.hooksPath=/x" passes validation (starts with --branch), but after split becomes ["--branch", "main", "--config", "core.hooksPath=/x"]. Git applies the config and executes attacker hooks during clone. This issue has been patched in version 3.1.47.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS