Executive brief
GitPython is a Python library used by applications to interact with Git repositories, including cloning and pulling code. Version 3.1.50 has a flaw in its security controls that is meant to block dangerous Git clone options—an attacker who controls clone parameters can bypass this protection by using an alternate syntax for the --upload-pack option, allowing arbitrary command execution during repository cloning.
Technical details
GitPython 3.1.50 implements a gate to block unsafe Git clone options (--upload-pack, -u, --config, -c) when allow_unsafe_options=False. The vulnerability is an OS command injection (CWE-78) in the option validation logic: the _canonicalize_option_name() function fails to recognize joined short-option forms such as -u<value> (Git's short form of --upload-pack=<value>). When Repo.clone_from(..., multi_options=["-u<helper>"], allow_unsafe_options=False) is called, the validator incorrectly canonicalizes -u<value> to "u<value>" instead of "u", causing it to bypass the blocked option check. Git then accepts the joined short option and executes the helper command. Attack vector is network (attacker controls multi_options passed to clone_from). The fix is available in GitPython 3.1.51.
Affected products
- GitPython GitPython 3.1.50
Timeline
- 2026-07-12: disclosed: GitHub security advisory GHSA-v396-v7q4-x2qj published
- 2026-08-01: advisory: CVE-2026-67324 published
- 2026-08-01: patched: Fix released in GitPython 3.1.51