CVE-2023-25815 Git looks for localized messages in the wrong place

Low 3.3 Published Updated

Low-privilege users can inject fake localized messages into Git for Windows, potentially tricking users into visiting malicious sites via social engineering.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-25815?

CVE-2023-25815 is a low-severity path traversal vulnerability in Fedoraproject Fedora, published on 25 Apr 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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:\`.

Weakness: CWE-22, CWE-134

Which versions are affected by CVE-2023-25815?

It affects 2 products.

Products include Fedoraproject Fedora, Git for Windows Project Git for Windows.

How do I fix CVE-2023-25815?

Apply the vendor's patch.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2023-25815 being exploited?

There is no known exploitation of CVE-2023-25815 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as ALPINE-CVE-2023-25815, CLEANSTART-2026-EP87015, CLSA-2023-1688673526, CLSA-2023-1688675103, CLSA-2024-1731599555, DEBIAN-CVE-2023-25815 and 2 more.

Is CVE-2023-25815 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free