REDHAT-BUG-2509976: Command Injection

Published Aug 1, 2026
·
Updated

GitPython before 3.1.51 fails to guard against dangerous Git options passed as keyword arguments in Repo.archive() and git.lsremote(), allowing command injection via options such as --exec/--upload-pack (leading to arbitrary command execution). Additionally, Repo.itercommits() and Repo.blame() do not check for leading-dash revision arguments, so a revision like --output=<path> can cause Git to open and truncate an arbitrary file. Exploitation requires an application that passes attacker-controlled arguments to these methods.

Affected Software

1 affected component
GitPython GitPython<3.1.51

Event History

Aug 1, 2026
Data Sourced
via Red Hat·01:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications using GitPython before 3.1.51 are exposed only if they pass attacker-controlled values as keyword arguments to Repo.archive() or git.ls_remote(), or as revision arguments to Repo.iter_commits() or Repo.blame().

2

What does an attacker need to supply to exploit the command-execution issue?

The attacker must be able to influence Git options passed through the affected methods. Dangerous options include --exec and --upload-pack, which can lead to arbitrary command execution.

3

What is the impact of the revision-argument issue?

A leading-dash revision such as --output=<path> passed to Repo.iter_commits() or Repo.blame() can cause Git to open and truncate an arbitrary file.

4

Are applications safe if they do not accept untrusted Git arguments?

Based on the available information, exploitation requires attacker-controlled arguments to reach the affected methods. Applications that do not pass attacker-controlled values to those method parameters are not described as exploitable.

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