External Control of File Name or Path Affecting git-for-windows/git package, versions [,2.40.1)


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.09% (28th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-GITFORWINDOWSGIT-5489782
  • published1 May 2023
  • disclosed1 May 2023
  • creditUnknown

Introduced: 1 May 2023

CVE-2023-25815  (opens in a new tab)
CWE-73  (opens in a new tab)

How to fix?

Upgrade git-for-windows/git to version 2.40.1 or higher.

Overview

Affected versions of this package are vulnerable to External Control of File Name or Path when the gettext() function uses the hard-coded path C:\mingw64\share\locale to look for localized messages. Since any authenticated user has the permission to create folders in C:\, it is possible for low-privilege users to place fake messages in that location, where git.exe will pick them up. 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, which makes this attack vector less likely.

Workaround

This vulnerability can be avoided by not working on a Windows machine with shared accounts, or by creating an empty C:\mingw64 folder. Alternatively, users who have administrative rights may remove the permission to create folders in C:\.

CVSS Base Scores

version 3.1