Skip to content

Git looks for localized messages in an unprivileged place

Low
vdye published GHSA-9w66-8mq8-5vm8 Apr 25, 2023

Package

git-for-windows (-)

Affected versions

<=2.40.0

Patched versions

v2.40.1

Description

Impact

In Git for Windows, 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 the change in msys2/MINGW-packages#10461, 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.

This vulnerability is relatively hard to exploit and requires a lot of 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.

Patches

The problem has been patched in Git for Windows v2.40.1.

Workarounds

Do not work on a Windows machine with shared accounts, or alternatively create a C:\mingw64 folder and leave it empty. If you have administrative rights, remove the permission to create folders in C:\.

References

Severity

Low
3.3
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:L

CVE ID

CVE-2023-25815

Credits