Description
Git is a revision control system. Prior to versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1, by feeding specially crafted input to `git apply --reject`, a path outside the working tree can be overwritten with partially controlled contents (corresponding to the rejected hunk(s) from the given patch). A fix is available in versions 2.30.9, 2.31.8, 2.32.7, 2.33.8, 2.34.8, 2.35.8, 2.36.6, 2.37.7, 2.38.5, 2.39.3, and 2.40.1. As a workaround, avoid using `git apply` with `--reject` when applying patches from an untrusted source. Use `git apply --stat` to inspect a patch before applying; avoid applying one that create a conflict where a link corresponding to the `*.rej` file exists.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| git | git | < 2.30.9, >= 2.31.0, < 2.31.8, >= 2.32.0, < 2.32.7, >= 2.33.0, < 2.33.8, >= 2.34.0, < 2.34.8, >= 2.35.0, < 2.35.8, >= 2.36.0, < 2.36.6, >= 2.37.0, < 2.37.7, >= 2.38.0, < 2.38.5, >= 2.39.0, < 2.39.3, >= 2.40.0, < 2.40.1 | — |
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 | git | 1:2.40.1-1 | — |
| Debian 13 | git | 1:2.40.1-1 | — |
| Debian 12 | git | 1:2.39.5-0+deb12u1 | DSA-5769-1 |
| Debian 11 | git | 1:2.30.2-1+deb11u3 | DLA-3867-1 |
| Debian 10 | git | 1:2.20.1-2+deb10u9 | DLA-3844-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | git | 1:2.34.1-1ubuntu1.9 | USN-6050-1 |
| Ubuntu 20.04 LTS | git | 1:2.25.1-1ubuntu3.11 | USN-6050-1 |
| Ubuntu 18.04 LTS | git | 1:2.17.1-1ubuntu0.18 | USN-6050-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 16.04 LTS | git | 1:2.7.4-0ubuntu1.10+esm7 | USN-6050-2 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9 | git +14 | 2.39.3-1.el9_2 | RHSA-2023:3245 |
| RHEL 8 | git +14 | 2.39.3-1.el8_8 | RHSA-2023:3246 |
| RHEL 7 | git +17 | 1.8.3.1-25.el7_9 | RHSA-2023:3263 |
| RHEL 3 | rh-git227-git +16 | 2.27.0-6.el7 | RHSA-2023:3280 |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9.0 EUS | git +14 | 2.31.1-5.el9_0 | RHSA-2023:3248 |
| RHEL 8.6 EUS | git +14 | 2.31.1-4.el8_6 | RHSA-2023:3247 |
| RHEL 8.4 EUS | git +14 | 2.27.0-4.el8_4 | RHSA-2023:3243 |
| RHEL 8.2 AUS | git +13 | 2.18.4-4.el8_2 | RHSA-2023:3382 |
| RHEL 8.1 E4S | git +13 | 2.18.4-3.el8_1 | RHSA-2023:3192 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 9 | git +14 | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 8 | git +14 | 2.39.3-1.el8_8 | ALSA-2023:3246 |
Rocky Linux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Rocky Linux 8 | git | 2.39.3-1.el8_8 | RLSA-2023:3246 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP4 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-1 |
| SLES 15 SP3 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SLES 15 SP2 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SLES 15 SP1 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SLES 12 SP5 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
Show 19 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP4 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SLES 12 SP2 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SLES for SAP 15 SP3 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SLES for SAP 15 SP2 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SLES for SAP 15 SP1 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SLES for SAP 12 SP5 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SLES for SAP 12 SP4 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SLE Real Time 15 SP3 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-1 |
| SLE HPC 15 SP3 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SLE HPC 15 SP2 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SLE HPC 15 SP1 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
| SUSE OpenStack Cloud Crowbar 9 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SUSE OpenStack Cloud 9 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SUSE OpenStack Cloud 8 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SUSE Manager Server 4.2 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SUSE Manager Proxy 4.2 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SUSE HPE Helion OpenStack 8 | git | 2.26.2-27.69.1 | SUSE-SU-2023:2062-1 |
| SUSE Enterprise Storage 7.1 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-2 |
| SUSE Enterprise Storage 7 | git | 2.26.2-150000.50.1 | SUSE-SU-2023:2081-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | git | 2.40.1-1.1 | openSUSE-SU-2024:12889-1 |
| openSUSE Leap 15.4 | git | 2.35.3-150300.10.27.1 | SUSE-SU-2023:2038-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | git | 2.40.1-r0 | — |
| Alpine v3.23 | git | 2.40.1-r0 | — |
| Alpine v3.22 | git | 2.40.1-r0 | — |
| Alpine v3.21 | git | 2.40.1-r0 | — |
| Alpine v3.20 | git | 2.40.1-r0 | — |
Show 6 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | git | 2.40.1-r0 | — |
| Alpine v3.18 | git | 2.40.1-r0 | — |
| Alpine v3.17 | git | 2.38.5-r0 | — |
| Alpine v3.16 | git | 2.36.6-r0 | — |
| Alpine v3.15 | git | 2.34.8-r0 | — |
| Alpine v3.14 | git | 2.32.7-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | git +16 | 2.40.1-1.amzn2023.0.1 | ALAS2023-2023-180 |
| Amazon Linux 2 | git +16 | 2.40.1-1.amzn2.0.1 | ALAS2-2023-2072 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | git +14 | 2.39.3-1.el9_2 | ELSA-2023-3245 |
| Oracle Linux 8 | git +14 | 2.39.3-1.el8_8 | ELSA-2023-3246 |
| Oracle Linux 7 | git +17 | 1.8.3.1-25.el7_9 | ELSA-2023-3263 |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | git | 2.40.1-r0 | — |
Advisories 34
- ALSA-2023:3245 Important: git security update AlmaLinux Security Advisories · Oct 29, 2026
- ALSA-2023:3246 Important: git security update AlmaLinux Security Advisories · Oct 29, 2026
- WID-SEC-2023-2031 Xerox FreeFlow Print Server: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 11, 2026
- WID-SEC-2024-0794 Dell ECS: Mehrere Schwachstellen BSI CERT-Bund (WID) · Aug 11, 2026
- RHSA-2023:3246 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Aug 5, 2026
- RHSA-2023:3245 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Aug 5, 2026
- RHSA-2023:3382 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3280 Red Hat Security Advisory: rh-git227-git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3248 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3263 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3247 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3243 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- RHSA-2023:3192 Red Hat Security Advisory: git security update Red Hat Security Advisories (RHSA) · Jun 30, 2026
- USN-6050-2 git vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- DSA-5769-1 git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3867-1 git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3844-1 git - security update Debian Security (DSA / DLA) · Mar 9, 2026
- USN-6050-1 git vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- RLSA-2023:3246 Important: git security update Rocky Linux Security Advisories · Feb 4, 2026
- openSUSE-SU-2024:12889-1 git-2.40.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2038-2 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2062-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2038-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:2081-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2023-2625 IBM QRadar SIEM: Mehrere Schwachstellen BSI CERT-Bund (WID) · Aug 6, 2025
- ICSA-25-105-08 ABB M2M Gateway CISA ICS & IT advisories · Apr 7, 2025
- 2NGA002579 ABB Arctic communication solution ARM600 Vulnerabilities ABB PSIRT · Apr 7, 2025
- WID-SEC-2023-1072 git: Mehrere Schwachstellen BSI CERT-Bund (WID) · Sep 18, 2024
- WID-SEC-2023-1446 Microsoft Developer Tools: Mehrere Schwachstellen BSI CERT-Bund (WID) · Sep 25, 2023
- ALAS2-2023-2072 Moderate: git security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Jun 7, 2023
- ALAS2023-2023-180 Moderate: git security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · May 24, 2023
- ELSA-2023-3246 Important: git security update (Oracle Linux 8) Oracle Linux Security Advisories (ELSA) · May 24, 2023
- ELSA-2023-3245 Important: git security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · May 23, 2023
- ELSA-2023-3263 Important: git security update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · May 23, 2023
References
- https://github.com/git/git/security/advisories/GHSA-2hvf-7c8p-28fx
- https://github.com/git/git/commit/18e2b1cfc80990719275d7b08e6e50f3e8cbc902
- https://github.com/git/git/commit/668f2d53613ac8fd373926ebe219f2c29112d93e
- http://www.openwall.com/lists/oss-security/2023/04/25/2
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PI7FZ4NNR5S5J5K6AMVQBH2JFP6NE4L7/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YFZWGQKB6MM5MNF2DLFTD7KS2KWPICKL/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RKOXOAZ42HLXHXTW6JZI4L5DAIYDTYCU/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BSXOGVVBJLYX26IAYX6PJSYQB36BREWH/
- https://security.gentoo.org/glsa/202312-15
- https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html