highCVSS 8.8Vulnerability

GHSA-2f96-g7mh-g2hx

## Command injection via long-option prefix abbreviation bypassing `check_unsafe_options` (incomplete fix of CVE-2026-42215 / GHSA-rpm5-65cw-6hj4) **Component:** gitpython-developers/GitPython (PyPI: GitPython) **Affected:** all versions carrying the 3.1.47 blocklist fix, through current `main` (verified at commit `20c5e275`, `3.1.50-42`) **CWE:** CWE-184 (Incomplete List of Disallowed Inputs) → CWE-78 (OS Command Injection) **Severity:** inherits the parent CVE-2026-42215 surface; estimated High, ~8.8 (`AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`) — final scoring deferred to maintainer/CNA, mirroring the parent. **Reporter:** hackkim ### Summary The 3.1.47 fix for CVE-2026-42215 blocks dangerous git options (`--upload-pack`, `--config`, `-c`, `-u` for clone; `--upload-pack` for fetch/pull; `--receive-pack`, `--exec` for push) so callers cannot reach command-executing options unless they pass `allow_unsafe_options=True`. The fix canonicalizes an option name along **one** axis (underscore→hyphen via `dashify`) and checks it against an **exact-match** dict. It does not account for git's unambiguous long-option prefix abbreviation. Git accepts any unambiguous prefix of a long option (`--upload-p`, `--upload-pa`, `--upload-pac` all resolve to `--upload-pack`). So a kwarg key like `upload_p` canonicalizes to `upload-p`, misses the blocklist dict, and is emitted to git as `--upload-p=<value>` → executed as `--upload-pack=<value>` → command injection, in the default `allow_unsafe_options=False` configuration. ### The asymmetry (root cause) ```python # git/cmd.py (commit 20c5e275), lines 948-974 @classmethod def _canonicalize_option_name(cls, option): option_name = option.lstrip("-").split("=", 1)[0] option_tokens = option_name.split(None, 1) if not option_tokens: return "" return dashify(option_tokens[0]) # only transform: "_" -> "-" @classmethod def check_unsafe_options(cls, options, unsafe_options): canonical_unsafe_options = {cls._canoni

Properties

ghsa_id
GHSA-2f96-g7mh-g2hx
summary
GitPython: Command Injection via git long-option prefix abbreviation bypass of CVE-2026-42215 blocklist
severity
high
cvss_score
8.8
cve_id
GHSA-2f96-g7mh-g2hx
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
is_ghsa_only
true
ghsa_published
2026-07-21T19:43:43Z
source_url
https://github.com/advisories/GHSA-2f96-g7mh-g2hx
ghsa_updated
2026-07-21T19:43:44Z

Related Entities (5)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/GitPython

AFFECTS (1)

[Software]pip/GitPython

HAS_WEAKNESS (2)

[Weakness]Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
[Weakness]Incomplete List of Disallowed Inputs

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-2f96-g7mh-g2hx (CVSS 8.8) — Ninja Signal Threat Intelligence | Ninja Signal