---
id: CVE-2026-87818
title: >-
  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
summary: >-
  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…
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'
cwe:
  - CWE-88
vendor: gitpython_project
product: gitpython
affected:
  - gitpython < 3.1.60
patched:
  - gitpython 3.1.60
published: '2026-09-09'
updated: '2026-09-16'
sourceUpdated: '2026-09-16T15:12:45.633'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-87818'
references:
  - url: >-
      https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-whh4-5q6c-9v3x
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/gitpython-3.1.59-local-file-content-oracle-via-no-index
    label: disclosure@vulncheck.com
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-87818'
  - url: 'https://github.com/advisories/GHSA-rw58-wc66-99g4'
  - url: 'https://github.com/gitpython-developers/GitPython/pull/2217'
  - url: >-
      https://github.com/gitpython-developers/GitPython/commit/09f2cf383a992d1af697364569e9f384748c1bd8
  - url: 'https://github.com/gitpython-developers/GitPython'
  - url: 'https://github.com/gitpython-developers/GitPython/releases/tag/3.1.60'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3983.yaml
tags:
  - nvd
  - cve.org
  - exploit-available
  - osv
  - pip
  - ghsa
epss: 0.00412
epssPercentile: 0.35259
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-09-09T14:06:42.660856Z'
ingestedAt: '2026-09-11T10:03:02.637Z'
aliases:
  - PYSEC-2026-3983
  - GHSA-whh4-5q6c-9v3x
  - GHSA-rw58-wc66-99g4
ecosystem: pip
---

## Overview

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.

## Affected

- `gitpython < 3.1.60`

## Remediation

Upgrade past the affected range:

- `gitpython 3.1.60`

## Package advisory (CVE-2026-87818)

Affected packages:

- `gitpython < 3.1.60`

Patched in:

- `gitpython 3.1.60`

Source: https://osv.dev/vulnerability/PYSEC-2026-3983
