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.
Published: 2026-08-19
Score: 7.2 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

GitPython versions before 3.1.58 have an arbitrary file overwrite flaw in methods that construct git read-tree commands. The flaw allows an attacker to inject the '--index-output' option through a caller‑supplied treeish string, causing the underlying git process to write a valid git-index blob to any file path the attacker can write to. This can erase existing file contents and, if the overwritten file is executable or used by a service, can lead to unauthorized execution or denial of service. The weakness corresponds to CWE-88, representing how unvalidated input can lead to unintended file system writes.

Affected Systems

The vulnerability affects the GitPython project, specifically any release before 3.1.58. Systems that employ GitPython in code that receives user‑supplied treeish values—such as build tools, deployment scripts, or other automation—are impacted. The risk applies to all operating systems where the affected GitPython version is installed.

Risk and Exploitability

With a CVSS score of 7.2 the flaw is considered high severity, although no EPSS value is available. The vulnerability is not yet listed in CISA's KEV catalog. Attackers can exploit the flaw locally by triggering GitPython operations with a crafted treeish string. The exploitation requires write access to target file paths, so the threat is most relevant when the executing environment has elevated permissions or when untrusted input can reach the GitPython API. Monitoring for unexpected file overwrites and applying the official upgrade are essential to mitigate this risk.

Generated by OpenCVE AI on August 19, 2026 at 19:22 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to version 3.1.58 or newer
  • Reject any treeish strings containing the '--index-output' option or otherwise validate input before passing to GitPython's read-tree methods
  • Restrict file system permissions on directories that GitPython writes to so that only trusted processes can modify files

Generated by OpenCVE AI on August 19, 2026 at 19:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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

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'}


Subscriptions

Gitpython Project Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-19T14:02:03.425Z

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

Link: CVE-2026-76219

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

Modified: 2026-08-19T14:17:48.187

Link: CVE-2026-76219

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-19T21:00:04Z

Weaknesses
  • CWE-88

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