CVE-2026-78677 adds --separate-git-dir to GitPython's unsafe_git_clone_options allowlist. Read that carefully: it adds the option to a list called "unsafe" — but that list is not a blocklist. It is an acknowledgment that the option will be passed through to git, not a gate preventing its use.
The vulnerability enables hook execution through a redirected git directory. When you call Repo.clone_from() with a separate_git_dir parameter, an attacker controlling that value can place the cloned repository's .git directory elsewhere — including into a location they already control or can influence. Since git automatically executes hooks from that directory upon subsequent operations, the attacker gains arbitrary code execution in the context of whoever performs operations on the cloned repository.
The critical realization is what the patch does NOT do. It does not sanitize the path, canonicalize it, restrict it to relative paths, or block .. traversal. It merely registers --separate-git-dir as "acknowledged dangerous" — and then permits it. This reveals the fundamental architecture problem: unsafe_git_clone_options is risk documentation, not enforcement. The list grows when someone notices a danger, not when the danger is actually mitigated.
Realistic preconditions matter here. This is an API-level attack — you need the ability to pass arguments to Repo.clone_from(). If an attacker already controls code execution in your Python process, this vulnerability becomes redundant; they could simply import os and run commands. However, the real exposure lives in systems that pass user-supplied URLs or repository parameters to GitPython: CI/CD pipelines cloning external repos, security scanners fetching code, deployment tools pulling from third-party sources. These are the contexts where hook execution becomes a supply chain pivot — the cloned repo may be cloned by a process with cloud credentials, deployment access, or network adjacency to production.
The severity rating of 7.5 reflects hook execution as a technical consequence without modeling what that consequence reaches through the systems GitPython actually powers. A developer cloning a repo on their laptop is low-risk. A pipeline doing the same with elevated credentials is high-risk.
If you use GitPython in any automated context, treat separate_git_dir as a user-controlled input that must be validated before passing to clone_from(). Sanitize it to relative paths only, reject absolute paths and traversal sequences, and document this requirement in your security guidance. The patch does not protect you — it documents that the danger exists.