mediumCVSS 6.5Vulnerability

GHSA-whh4-5q6c-9v3x

### Summary GitPython 3.1.59 blocks a previously available local-file read path through unsafe git diff options such as -O/--orderfile. However, the high-level diff API still permits --no-index with the default allow_unsafe_options=False. --no-index changes the semantics of the paths arguments: instead of repository-relative pathspecs, Git interprets them as arbitrary filesystem paths. When combined with the still-allowed -I/--ignore-matching-lines option, this creates a content-dependent Boolean oracle over a caller-selected local file. This was reproduced against the published GitPython 3.1.59 wheel. The original unsafe-option path is blocked in 3.1.59, while this alternate path remains reachable without setting allow_unsafe_options=True. ### Details Confirmed API surface: repo.index.diff( None, no_index=True, I=pattern, paths=[baseline_path, target_path], create_patch=True, ) The relevant behavior is: 1. --no-index makes the two values supplied via paths filesystem operands rather than repository pathspecs. 2. -I/--ignore-matching-lines makes Git's result depend on whether the supplied regular expression matches the relevant file content. 3. GitPython exposes the resulting bit through distinguishable behavior: - matching condition: normal return with an empty DiffIndex - non-matching condition: GitCommandError with exit status 1 An application that forwards attacker-influenced diff options and paths and exposes the success/error distinction can therefore be queried repeatedly to recover a guessable local single-line secret. The issue was confirmed with the default allow_unsafe_options=False. The behavior does not require the caller to explicitly opt into GitPython's unsafe-option mode. Verified intended security boundary: - GitPython 3.1.58 accepts the earlier -O/--orderfile local-file input path. - GitPython 3.1.59 rejects that same path with UnsafeOptionError. - GitPython 3.1.59 still permits the --no-index alternate pa

Properties

severity
medium
summary
GitPython: --no-index bypasses diff unsafe-option protections and enables a blind local-file content oracle
cvss_score
6.5
retrieved_at
2026-09-30T23:58:31+00:00
ghsa_published
2026-09-30T23:28:40Z
source_url
https://github.com/advisories/GHSA-whh4-5q6c-9v3x
ghsa_updated
2026-09-30T23:28:41Z
ghsa_id
GHSA-whh4-5q6c-9v3x
last_source
GitHub Advisory Database
cve_id
GHSA-whh4-5q6c-9v3x
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
signal_observed_at
2026-09-30T23:58:31+00:00
is_ghsa_only
true

Related Entities (5)

VULNERABLE_TO (1)

←[Software]pip/GitPython

AFFECTS (1)

→[Software]pip/GitPython

HAS_WEAKNESS (2)

→[Weakness]Exposure of Sensitive Information to an Unauthorized Actor
→[Weakness]Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

REPORTED_BY (1)

→[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-whh4-5q6c-9v3x (CVSS 6.5) — Ninja Signal Threat Intelligence | Ninja Signal