CVE-2026-67326: GitPython before 3.1.50 Newline Injection via config_writer section
GitPython before 3.1.50 fails to validate newline characters in the section parameter of configwriter(), allowing attackers to inject arbitrary section headers into .git/config. Attackers can inject newlines to create a forged [core] section with hooksPath pointing to attacker-controlled directories, achieving remote code execution when git hooks are triggered.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
gitpythonto a version that resolves this vulnerability.Fixed in 3.1.50 - Compensating control
Restrict which users/services can trigger Git hook execution (e.g., limit access to repositories/hooks execution paths) until GitPython is upgraded.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-67326?
The severity of CVE-2026-67326 is rated high with a score of 7.
How do I fix CVE-2026-67326?
To fix CVE-2026-67326, upgrade GitPython to version 3.1.50 or later.
What type of vulnerability is CVE-2026-67326?
CVE-2026-67326 is an input validation vulnerability due to failure in validating newline characters.
What can attackers do with CVE-2026-67326?
Attackers can exploit CVE-2026-67326 to inject arbitrary section headers into .git/config.
Which software versions are affected by CVE-2026-67326?
GitPython versions before 3.1.50 are affected by CVE-2026-67326.