Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
3.3

CVE-2023-25815: Git for Windows can show fake messages

CVE-2023-25815 · published 3 years ago
Summary

The Windows version of Git looks for translated text in a fixed folder (C:\mingw64\share\locale). A low‑privilege user who can create that folder can place their own files there, causing Git to display counterfeit messages that might mislead users. Upgrade to version 2.40.2 or later, or prevent users from creating folders in C:\, to remove the risk.

What to do
  • Update debian git to version 1:2.39.5-0+deb12u1.
  • Update debian git to version 1:2.40.1-1.
  • Update git to version 2.32.7-r0.
  • Update git to version 2.34.8-r0.
  • Update git to version 2.36.6-r0.
  • Update git to version 2.38.5-r0.
  • Update git to version 2.40.1-r0.
  • Update git_for_windows_project git_for_windows to version 2.40.1 or later.
Affected software
Ecosystem VendorProductAffected versions
Debian:12 debian git < 1:2.39.5-0+deb12u1
Fix: upgrade to 1:2.39.5-0+deb12u1
Debian:13 debian git < 1:2.40.1-1
Fix: upgrade to 1:2.40.1-1
Debian:14 debian git < 1:2.40.1-1
Fix: upgrade to 1:2.40.1-1
Alpine:v3.14 – git < 2.32.7-r0
Fix: upgrade to 2.32.7-r0
Alpine:v3.15 – git < 2.34.8-r0
Fix: upgrade to 2.34.8-r0
Alpine:v3.16 – git < 2.36.6-r0
Fix: upgrade to 2.36.6-r0
Alpine:v3.17 – git < 2.38.5-r0
Fix: upgrade to 2.38.5-r0
Alpine:v3.18 – git < 2.40.1-r0
Fix: upgrade to 2.40.1-r0
– git_for_windows_project git_for_windows < 2.40.1
cpe:2.3:a:git_for_windows_project:git_for_windows:*:*:*:*:*:*:*:*
– fedoraproject fedora 37
38
cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
– git-for-windows git < 2.40.1
Original advisory text
Git 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:\`.
Fix within
Internet-facing 60 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit
  • Gives an attacker partial control
Severity
3.3 Low
Exploitation
<1% chance of attack within 30 days
Type
CWE-22Path Traversal
CWE-134Use of Externally-Controlled Format String
Timeline
Published25 Apr 2023
Updated7 Nov 2026
First seen15 Sep 2026
Sources
CVE-2023-25815 · NVD
CVE-2023-25815 · MITRE
Track software like this
Free during beta