REDHAT-BUG-2515261: High severity GitPython GitPython vulnerability

Published Aug 13, 2026
·
Updated

GitPython before 3.1.57 fails to guard git option forwarding in IndexFile.checkout() and TagReference.create(), allowing attackers to pass unsafe options via kwargs. Attackers can use --prefix to overwrite arbitrary files with repository content or -F to read arbitrary files returned in-band.

Affected Software

1 affected component
GitPython GitPython<3.1.57

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.57

Event History

Aug 13, 2026
Data Sourced
via Red Hat·12:03 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What attacker access is required to exploit this issue?

An attacker must be able to influence keyword arguments passed to GitPython's IndexFile.checkout() or TagReference.create() methods. The issue arises when those kwargs are forwarded as Git command-line options without adequate validation.

2

What impact can unsafe options have?

The --prefix option can be used to overwrite arbitrary files with repository content. The -F option can read arbitrary files and return their contents in-band.

3

Which deployments should be prioritized for review?

Prioritize applications using GitPython versions before 3.1.57 where untrusted users, requests, plugins, or automation inputs can affect kwargs supplied to IndexFile.checkout() or TagReference.create().

4

How can exposure be reduced if an update cannot be applied immediately?

Prevent untrusted input from reaching kwargs for IndexFile.checkout() and TagReference.create(), and allow only explicitly validated option names and values. Avoid forwarding user-controlled Git options, particularly --prefix and -F.

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