Description
GitPython before 3.1.50 fails to validate newline characters in the section parameter of config_writer(), 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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| gitpython-developers | GitPython | < 3.1.50 | 3.1.50 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-git | 3.1.50-1 | — |
| Debian 13 | python-git | 3.1.44-1+deb13u1 | — |
| Debian 12 | python-git | 3.1.30-1+deb12u3 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 26.04 LTS | python-git | No fix yet | — |
| Ubuntu Pro 24.04 LTS | python-git | No fix yet | — |
| Ubuntu Pro 22.04 LTS | python-git | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | python-git | No fix yet | — |
| Ubuntu Pro 18.04 LTS | python-git | No fix yet | — |
| Ubuntu Pro 16.04 LTS | python-git | No fix yet | — |
| Ubuntu Pro 14.04 LTS | python-git | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Hardened Images 1 | lld +39 | 22.1.8-4.1.hum1 | RHSA-2026:44416 |
| Red Hat Hardened Images 1 | lld21 +25 | 21.1.8-8.hum1 | RHSA-2026:45940 |
| Red Hat Hardened Images 1 | swift-lang +1 | 6.3.3-0.1.1.hum1 | RHSA-2026:45785 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP6 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLES 15 SP5 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLES 15 SP4 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLES 3 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 15 SP6 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLES for SAP 15 SP5 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLES for SAP 15 SP4 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLE HPC 15 SP5 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
| SLE HPC 15 SP4 | python-GitPython | 3.1.34.1693646983.2a2ae77-150400.9.8.1 | SUSE-SU-2026:4072-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-GitPython | 3.1.58-1.1 | openSUSE-SU-2026:11466-1 |
| openSUSE Leap 16.0 | python-GitPython | 3.1.44-160000.4.1 | openSUSE-SU-2026:21874-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | gitpython | < 3.1.50 | 3.1.50 | GHSA-mv93-w799-cj2w |
Advisories 6
- RHSA-2026:45940 Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update Red Hat Security Advisories (RHSA) · Oct 20, 2026
- RHSA-2026:45785 Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update Red Hat Security Advisories (RHSA) · Oct 20, 2026
- RHSA-2026:44416 Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update Red Hat Security Advisories (RHSA) · Oct 20, 2026
- openSUSE-SU-2026:21874-1 Security update for python-GitPython SUSE / openSUSE Security Updates · Sep 25, 2026
- SUSE-SU-2026:4072-1 Security update for python-GitPython SUSE / openSUSE Security Updates · Sep 13, 2026
- openSUSE-SU-2026:11466-1 python313-GitPython-3.1.58-1.1 on GA media SUSE / openSUSE Security Updates · Aug 7, 2026
References
- GitHub Security Advisory (GHSA-mv93-w799-cj2w) vendor-advisory
- VulnCheck Advisory: GitPython before 3.1.50 Newline Injection via config_writer section third-party-advisory