Description
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.
Published: 2026-08-19
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

GitPython versions before 3.1.58 do not validate certain options passed to git rm and git checkout commands in the IndexFile.remove() and Head.checkout() functions. This is a CWE‑73 weakness relating to improper input validation that allows attackers to access arbitrary files. An attacker can supply the --pathspec-from-file and --pathspec-file-nul parameters so that Git attempts to read the file specified by the attacker. The full contents of that file are returned in GitCommandError.stderr, allowing the attacker to extract data from files that the process can read.

Affected Systems

The vulnerability affects the GitPython library for any deployment using versions earlier than 3.1.58. It applies to all environments where an unpatched version of the open‑source GitPython project is imported and used in Python code.

Risk and Exploitability

With a CVSS score of 7.1, the flaw presents a medium‑to‑high risk. The EPSS score is < 1% and the flaw is not yet listed in CISA KEV, suggesting no widespread exploitation yet. Based on the description, it is inferred that exploitation requires an attacker to influence which options are passed to git rm or git checkout, such as by controlling input to the library’s functions. Once those parameters are set, the vulnerable code reads the specified file and leaks its contents via the error output, giving attackers read access to arbitrary files accessible to the process.

Generated by OpenCVE AI on August 28, 2026 at 20:10 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade GitPython to version 3.1.58 or later to receive the built‑in validation fix.
  • If an immediate upgrade is not possible, sanitize all arguments sent to git rm and git checkout, rejecting any --pathspec-from-file or --pathspec-file-nul options that originate from untrusted sources.
  • Audit and modify any custom wrappers or scripts that invoke GitPython to eliminate the use of unvalidated command options and restrict exposed interfaces to trusted input.

Generated by OpenCVE AI on August 28, 2026 at 20:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-hh9p-6wh2-4mfc GitPython: Arbitrary file read via --pathspec-from-file in IndexFile.remove() and Head.checkout()
History

Thu, 03 Sep 2026 15:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-88
References
Metrics threat_severity

None

threat_severity

Moderate


Tue, 25 Aug 2026 02:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 14:15:00 +0000

Type Values Removed Values Added
Description 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.
Title GitPython before 3.1.58 Arbitrary File Read via pathspec-from-file
First Time appeared Gitpython Project
Gitpython Project gitpython
Weaknesses CWE-73
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-25T01:56:17.646Z

Reserved: 2026-08-19T11:35:13.689Z

Link: CVE-2026-76217

cve-icon Vulnrichment

Updated: 2026-08-25T01:56:12.061Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-19T14:17:47.903

Modified: 2026-09-03T15:01:08.697

Link: CVE-2026-76217

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-19T14:02:02Z

Links: CVE-2026-76217 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-28T20:15:06Z

Weaknesses
  • CWE-73

    External Control of File Name or Path

  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')