CVE-2026-76219: GitPython before 3.1.58 Arbitrary File Overwrite via read-tree

Published Aug 19, 2026
·
Updated

GitPython versions before 3.1.58 contain an arbitrary file overwrite vulnerability in IndexFile.fromtree, IndexFile.reset, and IndexFile.mergetree 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.

Affected Software

1 affected component
GitPython GitPython<3.1.58

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade GitPython to a version that resolves this vulnerability.

    Fixed in 3.1.58
  2. Compensating control

    Apply the fix by validating inputs and ensuring the --index-output argument is never influenced by untrusted callers, so attacker-controlled treeish strings cannot be appended to git read-tree arguments.

Event History

Aug 19, 2026
CVE Published
via MITRE·02:02 PM
Data Sourced
via MITRE·02:02 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Applications using GitPython versions before 3.1.58 are exposed if they call IndexFile.from_tree, IndexFile.reset, or IndexFile.merge_tree with treeish strings influenced by a lower-privileged attacker.

2

What does an attacker need to exploit it?

The attacker needs the ability to influence a treeish string passed to one of the affected methods. They can inject the --index-output option and target a path that is writable in the context of the affected application.

3

What is the impact of successful exploitation?

Successful exploitation can overwrite an arbitrary writable file with a valid Git index blob. This destroys the existing contents of the targeted file and can affect integrity and availability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203