CVE-2026-76219

GitPython before 3.1.58 Arbitrary File Overwrite via read-tree

Published Aug 19, 2026 CVSS 4.0 · 7.2 High EPSS < 1% KEV · Not listed
Description
GitPython versions before 3.1.58 contain an arbitrary file overwrite vulnerability in IndexFile.from_tree, IndexFile.reset, and IndexFile.merge_tree methods that append caller-influenced treeish strings to git read-tree without option validation or argument separation. Attackers can inject the --index-output option to overwrite arbitrary files with a valid git-index blob, destroying existing file content at attacker-controlled writable paths.

Analysis

AI-generated

Technical impact

GitPython versions before 3.1.58 contain a flaw in IndexFile.from_tree, IndexFile.reset, and IndexFile.merge_tree that appends caller‑supplied treeish strings directly to git read‑tree commands. The flaw allows an attacker to inject the --index-output option so that the underlying git process writes a valid git‑index blob to any file path the attacker can write to. This results in the destruction of existing file content.

Affected Systems

The vulnerability affects the GitPython project; any installation of the library prior to release 3.1.58 on any operating system where the code receives untrusted treeish input—such as build tools, deployment scripts, or automation code—may be impacted.

Risk and Exploitability

The CVSS score of 7.2 indicates high severity. The EPSS score of <1% suggests a low probability of exploitation and it is not listed in CISA's KEV catalog. Based on the description, it is inferred that the likely attack vector is a local user or process that supplies a malicious treeish string to GitPython’s read‑tree methods, for example through an insecure API endpoint or command. Exploitation requires write permission to the target file path, so the threat is most relevant where the executing process runs with elevated privileges or where untrusted input can reach the API. Monitoring for unexpected file overwrites and applying the official upgrade are recommended.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to GitPython 3.1.58 or later
  • Validate and sanitize all user‑supplied treeish strings before passing them to GitPython’s read‑tree methods, ensuring the --index-output option is not present
  • Restrict write permissions on directories that GitPython writes to so that only trusted processes can modify files

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

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
Github GHSA Github GHSA GHSA-4gmw-gg2m-w46p GitPython: Unguarded git read-tree option forwarding in IndexFile.from_tree/reset/merge_tree enables arbitrary file overwrite
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Type Values Removed Values Added
Description GitPython versions before 3.1.58 contain an arbitrary file overwrite vulnerability in IndexFile.from_tree, IndexFile.reset, and IndexFile.merge_tree methods that append caller-influenced treeish strings to git read-tree without option validation or argument separation. Attackers can inject the --index-output option to overwrite arbitrary files with a valid git-index blob, destroying existing file content at attacker-controlled writable paths.
Title GitPython before 3.1.58 Arbitrary File Overwrite via read-tree
First Time appeared Gitpython Project
Gitpython Project gitpython
Weaknesses CWE-88
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
References
Metrics cvssV3_1

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

cvssV4_0

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

Weaknesses
  • CWE-88

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

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:25 PM
Reserved
Aug 19, 2026, 11:35 AM
Status
Analyzed
Published
Aug 19, 2026, 2:17 PM
Modified
Sep 3, 2026, 3:03 PM
Severity
Important
Public date
Aug 19, 2026, 2:02 PM