CVE-2023-25815
Git looks for localized messages in the wrong place
Reported by github_m · Published April 25, 2023
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:\`.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| git_for_windows | git_for_windows_project | 2.40.1 |
| Microsoft .NET Framework 3.5 | Microsoft | 3.0.6920.8954; 2.0.50727.8970 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| git-for-windows | git | < 2.40.1 |
| git-for-windows | git | 0 |
| alpine | git | 0, 0, 0 |
Timeline
- Apr 25, 2023 CVE Published
- Apr 26, 2023 EPSS Score (30 in total, the first dated here)
- Oct 5, 2023 PoC Published (2 in total, the first dated here)
- Feb 19, 2026 Security Advisory (30 in total, the first dated here)
- Mar 21, 2026 Distribution Patch (24 in total, the first dated here)
- Nov 2, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-25815
vulnetix vdb fixes CVE-2023-25815
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-25815/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/git-for-windows/git/security/advisories/GHSA-9w66-8mq8-5vm8 x_refsource_CONFIRM
- https://github.com/msys2/MINGW-packages/pull/10461 x_refsource_MISC
- https://axcheron.github.io/exploit-101-format-strings/#writing-to-the-stack x_refsource_MISC
- https://github.com/git-for-windows/git/releases/tag/v2.40.1.windows.1 x_refsource_MISC
- https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2024/09/msg00009.html url