CVE-2023-25815Git looks for localized messages in the wrong place
In Git for Windows, the Windows port of Git, no localized messages are shipped with the installer. As a consequence, Git is expected not to localize messages at all, and skips the gettext initialization. However, due to a change in MINGW-packages, the `gettext()` function's implicit initialization no longer uses the runtime prefix but uses the hard-coded path `C:\mingw64\share\locale` to look for localized messages. And since any authenticated user has the permission to create folders in `C:\` (and since `C:\mingw64` does not typically exist), it is possible for low-privilege users to place fake messages in that location where `git.exe` will pick them up in version 2.40.1. This vulnerability is relatively hard to exploit and requires social engineering. For example, a legitimate message at the end of a clone could be maliciously modified to ask the user to direct their web browser to a malicious website, and the user might think that the message comes from Git and is legitimate. It does require local write access by the attacker, though, which makes this attack vector less likely. Version 2.40.1 contains a patch for this issue. Some workarounds are available. Do not work on a Windows machine with shared accounts, or alternatively create a `C:\mingw64` folder and leave it empty. Users who have administrative rights may remove the permission to create folders in `C:\`.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | git | Fixed | 1:2.34.1-1ubuntu1.9 | UBUNTU-CVE-2023-25815 |
| Ubuntu 20.04 | git | Fixed | 1:2.25.1-1ubuntu3.11 | UBUNTU-CVE-2023-25815 |
| Ubuntu 18.04 | git | Fixed | 1:2.17.1-1ubuntu0.18 | UBUNTU-CVE-2023-25815 |
| Ubuntu 16.04 | git | Fix pending | 1:2.7.4-0ubuntu1.10+esm8 (Ubuntu Pro) | UBUNTU-CVE-2023-25815 |
| Debian 14 | git | Fixed | 1:2.40.1-1 | DEBIAN-CVE-2023-25815 |
| Debian 13 | git | Fixed | 1:2.40.1-1 | DEBIAN-CVE-2023-25815 |
| Debian 12 | git | Fixed | 1:2.39.5-0+deb12u1 | DEBIAN-CVE-2023-25815 |
| Red Hat Enterprise Linux 9 | git | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-all | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-core | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-core-doc | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-credential-libsecret | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-daemon | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-email | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-gui | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-instaweb | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-subtree | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | git-svn | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | gitk | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | gitweb | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | perl-Git | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 9 | perl-Git-SVN | Fixed | 0:2.39.3-1.el9_2 | RHSA-2023:3245 |
| Red Hat Enterprise Linux 8 | git | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-all | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-core | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-core-doc | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-credential-libsecret | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-daemon | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-email | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-gui | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-instaweb | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-subtree | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | git-svn | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | gitk | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | gitweb | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | perl-Git | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 8 | perl-Git-SVN | Fixed | 0:2.39.3-1.el8_8 | RHSA-2023:3246 |
| Red Hat Enterprise Linux 7 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-bzr | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gnome-keyring | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-hg | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-instaweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-p4 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Git-SVN | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | emacs-git-el | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-all | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-cvs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-daemon | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-email | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-gui | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | git-svn | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitk | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | gitweb | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | perl-Git | Will not fix Out of support scope | ||
| AlmaLinux 9 | git | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-all | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-core | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-core-doc | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-credential-libsecret | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-daemon | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-email | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-gui | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-instaweb | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-subtree | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | git-svn | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | gitk | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | gitweb | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | perl-Git | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 9 | perl-Git-SVN | Fixed | 2.39.3-1.el9_2 | ALSA-2023:3245 |
| AlmaLinux 8 | git | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-all | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-core | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-core-doc | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-credential-libsecret | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-daemon | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-email | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-gui | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-instaweb | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-subtree | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | git-svn | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | gitk | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | gitweb | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | perl-Git | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| AlmaLinux 8 | perl-Git-SVN | Fixed | 2.39.3-1.el8_8 | ALSA-2023:3246 |
| Rocky Linux 8 | git | Fixed | 0:2.39.3-1.el8_8 | RLSA-2023:3246 |
| Alpine Linux 3.24 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.23 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.22 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.21 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.20 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.19 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.18 | git | Fixed | 2.40.1-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.17 | git | Fixed | 2.38.5-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.16 | git | Fixed | 2.36.6-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.15 | git | Fixed | 2.34.8-r0 | ALPINE-CVE-2023-25815 |
| Alpine Linux 3.14 | git | Fixed | 2.32.7-r0 | ALPINE-CVE-2023-25815 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- git-for-windows git: affected: < 2.40.1
References
- https://github.com/git-for-windows/git/security/advisories/GHSA-9w66-8mq8-5vm8
- https://github.com/msys2/MINGW-packages/pull/10461
- https://axcheron.github.io/exploit-101-format-strings/#writing-to-the-stack
- https://github.com/git-for-windows/git/releases/tag/v2.40.1.windows.1
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
- 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://security.gentoo.org/glsa/202312-15
- https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.