---
id: CVE-2026-76217
title: GitPython before 3.1.58 Arbitrary File Read via pathspec-from-file
summary: >-
  GitPython versions before 3.1.58 fail to validate options passed to git rm and
  git checkout commands in IndexFile.remove() and Head.checkout(). Attackers can
  supply --pathspec-from-file and --pathspec-file-nul parameters to read
  arbitrar…
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'
cvssSource: cna
cwe:
  - CWE-73
  - CWE-200
vendor: gitpython-developers
product: GitPython
affected:
  - GitPython < 3.1.58
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-25T01:55:55.427917Z'
exploitAvailable: true
published: '2026-08-19'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T15:25:00.070Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-76217'
references:
  - url: >-
      https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-hh9p-6wh2-4mfc
    label: GitHub Security Advisory (GHSA-hh9p-6wh2-4mfc)
  - url: >-
      https://www.vulncheck.com/advisories/gitpython-before-arbitrary-file-read-via-pathspec-from-file
    label: >-
      VulnCheck Advisory: GitPython before 3.1.58 Arbitrary File Read via
      pathspec-from-file
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-76217'
  - url: 'https://github.com/gitpython-developers/GitPython/pull/2204'
  - url: >-
      https://github.com/gitpython-developers/GitPython/commit/f2550b65bf60ca087190981e2c7b6865e201f40c
  - url: 'https://github.com/gitpython-developers/GitPython'
  - url: 'https://github.com/gitpython-developers/GitPython/releases/tag/3.1.58'
  - url: 'https://pypi.org/project/gitpython'
  - url: 'https://github.com/advisories/GHSA-hh9p-6wh2-4mfc'
tags:
  - cve.org
  - exploit-available
  - osv
  - pip
  - ghsa
epss: 0.00412
epssPercentile: 0.35259
aliases:
  - GHSA-hh9p-6wh2-4mfc
  - PYSEC-2026-3841
ecosystem: pip
patched:
  - gitpython 3.1.58
ingestedAt: '2026-08-20T19:23:06.167Z'
---

## Overview

GitPython versions before 3.1.58 fail to validate options passed to git rm and git checkout commands in IndexFile.remove() and Head.checkout(). Attackers can supply --pathspec-from-file and --pathspec-file-nul parameters to read arbitrary files accessible to the process, with full file contents returned in GitCommandError.stderr.

## Affected

- `GitPython < 3.1.58`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-76217)

Affected packages:

- `gitpython < 3.1.58`

Patched in:

- `gitpython 3.1.58`

Source: https://osv.dev/vulnerability/GHSA-hh9p-6wh2-4mfc
