CVE-2023-25815
Git looks for localized messages in the wrong place
Check your servers for CVE-2023-25815
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-25815 affects git, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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:\`.
Severity (CVSS)
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:L
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.84%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 55.1% of all scored CVEs. Scores of 30 Nov 2026.
The assessment of CISA (SSVC, 2 Nov 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
- CWE-134 Use of Externally-Controlled Format String
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| git |
affected < 2.40.1
|
Is my server affected?
Find the installed version of git and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i git
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-25815 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-25815RHEL, Rocky, Alma, Fedora
rpm -q git
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-25815Alpine
apk list --installed | grep -i gitWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-25815
trivy image --scanners vuln IMAGE | grep CVE-2023-25815
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://github.com/msys2/MINGW-packages/pull/10461 github.com
- https://axcheron.github.io/exploit-101-format-strings/#writing-to-the-stack axcheron.github.io
- https://github.com/git-for-windows/git/releases/tag/v2.40.1.windows.1 github.com
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html pubs.opengroup.org
- http://www.openwall.com/lists/oss-security/2023/04/25/2 openwall.com
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PI7FZ4NNR5S5J5K6AMVQBH2JFP6NE4L7/ lists.fedoraproject.org
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YFZWGQKB6MM5MNF2DLFTD7KS2KWPICKL/ lists.fedoraproject.org
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RKOXOAZ42HLXHXTW6JZI4L5DAIYDTYCU/ lists.fedoraproject.org
- https://security.gentoo.org/glsa/202312-15 security.gentoo.org
- https://lists.debian.org/debian-lts-announce/2024/06/msg00018.html lists.debian.org
- https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html lists.debian.org
Source: the record CVE-2023-25815 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse