GHSA-MV93-W799-CJ2W: Remote Code Execution via Config Section Injection in GitPython
Vulnerability ID: GHSA-MV93-W799-CJ2W
CVSS Score: 7.8
Published: 2026-05-08
GitPython versions prior to 3.1.50 are vulnerable to a newline injection attack in the config_writer() and set_value() methods. An incomplete fix for CVE-2026-44244 failed to sanitize the configuration section parameter, allowing an attacker to inject malicious Git configuration blocks such as [core] and override the hooksPath. This leads to unauthenticated remote code execution when subsequent Git operations trigger the injected hooks.
TL;DR
Newline injection in GitPython's config_writer section parameter allows attackers to override core.hooksPath and achieve Remote Code Execution.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-94, CWE-150
- Attack Vector: Local (via Application Input)
- CVSS Base Score: 7.8 (High)
- Exploit Status: Proof of Concept Available
- Impact: Remote Code Execution via Git Hooks
- Patched Version: 3.1.50
Affected Systems
- GitPython pip package
-
GitPython: < 3.1.50 (Fixed in:
3.1.50)
Mitigation Strategies
- Upgrade GitPython pip package to version 3.1.50 or later.
- Implement application-level input validation to sanitize user input passed to GitPython API.
- Reject or strip newline characters (\n, \r) from configuration section variables.
- Monitor .git/config files for anomalous structures and unexpected hooksPath entries.
Remediation Steps:
- Identify all projects utilizing the GitPython library within the environment.
- Update the GitPython dependency to >= 3.1.50 via package manager (e.g., pip install --upgrade GitPython).
- Review application source code for calls to
config_writer().set_value()andconfig_writer().add_section(). - Ensure input passed to these methods is heavily sanitized if derived from external sources.
- Deploy file integrity monitoring rules to alert on modifications to repository
.git/configfiles introducing newhooksPathdirectives.
References
- GitHub Advisory Database: GHSA-MV93-W799-CJ2W
- GitPython Security Advisories
- GitLab Advisory Database: GHSA-mv93-w799-cj2w
- NVD Detail (Related CVE-2026-44244)
Read the full report for GHSA-MV93-W799-CJ2W on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)