CVE-2026-87818 in GitPythoninfo

Summary

by MITRE • 09/09/2026

GitPython 3.1.59 fails to restrict the --no-index option in the high-level diff API, allowing attackers to read arbitrary filesystem paths as repository operands. Attackers can combine --no-index with -I/--ignore-matching-lines to create a content-dependent Boolean oracle, repeatedly querying local files to recover single-line secrets through distinguishable success or error responses.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 09/09/2026

The vulnerability in GitPython versions prior to 3.1.60 represents a critical security flaw within the high-level diff API that stems from insufficient input validation and improper handling of command-line arguments passed to underlying git processes. Specifically, the library fails to restrict or sanitize the --no-index option when constructing diff operations. In standard git usage, this flag allows users to compare two arbitrary paths on the filesystem rather than comparing commits within a repository. By failing to enforce restrictions on this parameter, GitPython inadvertently exposes an interface that permits attackers to specify any local file path as an operand for comparison against another specified path or commit state. This lack of restriction transforms what should be a controlled version control operation into a mechanism capable of arbitrary file reading, bypassing the intended scope of repository-based operations and violating the principle of least privilege by granting access to sensitive system files outside the target repository context.

The operational impact of this vulnerability is severe due to its potential for data exfiltration through side-channel attacks. Attackers can exploit the ability to read arbitrary filesystem paths by combining the --no-index flag with the -I or --ignore-matching-lines option. This combination allows for the creation of a content-dependent Boolean oracle, where the success or failure response from git serves as an indicator of whether specific patterns exist within the target file. By iteratively querying local files and analyzing these distinguishable responses, attackers can recover sensitive information such as single-line secrets, API keys, passwords, or configuration data one character at a time. This technique effectively turns a version control utility into a powerful remote code execution-like vector for data theft, enabling adversaries to extract confidential credentials from the host system without direct access to those files through traditional read permissions if they can manipulate the git process behavior via this specific API endpoint.

From a classification perspective, this vulnerability aligns with CWE-78 Improper Neutralization of Special Elements used in an OS Command and CWE-200 Exposure of Sensitive Information to an Unauthorized Actor. The failure to restrict input options constitutes a command injection variant where the attacker influences the behavior of a system utility through crafted arguments rather than injecting code directly into execution streams. Furthermore, the exploitation method involving iterative querying for information recovery maps closely to ATT&CK technique T1504 Weak or Compromised Cryptographic Algorithms if used in conjunction with cryptographic material extraction, but more accurately reflects T1083 File and Directory Discovery combined with T1213 Data from Information Repositories. The use of a Boolean oracle is also characteristic of blind injection techniques often seen in SQLi contexts but applied here to filesystem interaction via git commands.

Mitigation strategies must focus on immediate patching and defensive coding practices within applications utilizing GitPython. Organizations should upgrade to version 3.1.60 or later, where the maintainers have addressed this issue by enforcing stricter validation of input parameters passed to diff operations. For environments unable to update immediately, developers can implement a whitelist approach for allowed paths in custom wrappers around the gitpython API, ensuring that only expected repository-relative paths are processed. Additionally, running applications with elevated privileges or access to sensitive directories should be avoided where possible, and strict sandboxing policies using operating system-level controls like SELinux or AppArmor can help limit the damage if an attacker manages to exploit this vulnerability by restricting what files the git process is permitted to read regardless of command-line arguments provided.

Responsible

VulnCheck

Reservation

09/09/2026

Disclosure

09/09/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!