CVE-2026-78676: GitPython before 3.1.59 Remote Code Execution via Config Injection

Published Aug 25, 2026
·
Updated

GitPython before 3.1.59 fails to safely re-serialize multi-line git-config values during write operations, corrupting dormant quoted values into injected directives like core.hooksPath. Attackers can craft config files with embedded newlines that become live git directives after any unrelated GitPython config write, enabling arbitrary code execution via hook invocation.

Affected Software

1 affected component
GitPython GitPython<3.1.59

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.59
  2. Compensating control

    Ensure GitPython configuration files cannot be modified by untrusted users prior to GitPython config write operations, to prevent injected directives from being created and later invoked via git hooks (e.g., restrict filesystem permissions/ownership for git config locations and hook paths).

Event History

Aug 25, 2026
CVE Published
via MITRE·01:30 AM
Data Sourced
via MITRE·01:30 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to exploitation?

Applications using GitPython before 3.1.59 are exposed if they read an attacker-crafted Git configuration and later perform any GitPython configuration write. The write can be unrelated to the malicious value.

2

What does an attacker need to do?

An attacker needs to supply or cause the use of a Git config containing a multi-line quoted value with embedded newlines. When GitPython re-serializes that value during a config write, the injected content can become an active directive such as core.hooksPath.

3

How can this lead to code execution?

The injected core.hooksPath directive can redirect Git to attacker-controlled hooks. Code execution occurs when Git invokes a hook from that configured path.

4

What is the available remediation?

Upgrade GitPython to version 3.1.59 or later. The issue affects versions before 3.1.59.

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