CVE-2026-78676: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') in gitpython-developers GitPython
Description
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.
CVSS v4.0
Score 9.3critical
Affected software
gitpython-developers
GitPython
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
GitPython's GitConfigParser reads multi-line config values using standard git syntax, decoding escape sequences into embedded newlines. However, when rewriting the config file, GitPython uses an unsafe serialization method that replaces embedded newlines with a newline plus tab without proper quoting or continuation markers. This causes the second line of a multi-line value to be interpreted as a new config directive on subsequent reads. An attacker can craft a dormant multi-line config value that, after a legitimate config write operation by GitPython, injects a new core.hooksPath directive pointing to attacker-controlled hooks. Since Git hooks are executed by many git operations, this leads to arbitrary code execution. The vulnerability exists because the injection guard only applies to write-time arguments, not to values read from disk and rewritten. The affected version is GitPython 3.1.58 and earlier, fixed in 3.1.59.
Potential Impact
An attacker who can place a specially crafted multi-line config value in a Git repository's config file or an included config file can cause GitPython to rewrite the config file in a way that injects a new core.hooksPath directive. This directive controls the path for Git hooks, which are executed by many Git commands. As a result, arbitrary code execution can occur when the host application or user performs any hook-triggering Git operation. The vulnerability is critical due to the potential for remote code execution without authentication or user interaction.
Mitigation Recommendations
A fix is available in GitPython version 3.1.59 that addresses this issue by correcting the unsafe re-serialization of multi-line config values. Users should upgrade to GitPython 3.1.59 or later. Until upgraded, avoid performing config write operations on repositories with untrusted or attacker-controlled multi-line config values. Review and sanitize any included config files to ensure they do not contain malicious multi-line values. No other mitigations are documented by the vendor.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-25T01:17:12.262Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8cf57dacd9273b498428dc
Added to database: 08/25/2026, 01:53:01 UTC
Last enriched: 09/18/2026, 01:53:07 UTC
Last updated: 10/09/2026, 06:48:19 UTC
Views: 169
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.