Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2023-25815: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in git-for-windows git

0
Low
VulnerabilityCVE-2023-25815cvecve-2023-25815cwe-22cwe-134
Published: Tue Apr 25 2023 (04/25/2023, 19:51:38 UTC)
Source: CVE Database V5
Vendor/Project: git-for-windows
Product: git

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

AI-Powered Analysis

AILast updated: 11/04/2025, 16:49:17 UTC

Technical Analysis

CVE-2023-25815 is a path traversal vulnerability affecting Git for Windows prior to version 2.40.1. The root cause is a change in the MINGW-packages that altered the behavior of the gettext() function used for localization. Instead of using a runtime prefix for localized message files, gettext() now uses a hardcoded path (C:\mingw64\share\locale). Since typical Windows installations allow any authenticated user to create folders in the root C:\ directory, an attacker with low privileges can create a fake C:\mingw64 directory and place malicious localized message files there. When Git executes, it loads these messages, potentially displaying attacker-controlled content. This can be exploited to perform social engineering attacks, such as displaying misleading messages that prompt users to visit malicious websites. The vulnerability requires local write access and user interaction, making exploitation relatively difficult. It does not directly compromise confidentiality but can impact integrity by misleading users and availability by causing unexpected behavior. The issue is patched in Git version 2.40.1. Workarounds include restricting folder creation permissions on C:\, creating an empty C:\mingw64 directory to prevent attacker placement, and avoiding shared Windows accounts. No known exploits are reported in the wild.

Potential Impact

For European organizations, this vulnerability primarily poses a risk in environments where multiple users share Windows machines with Git for Windows installed, especially in development or build environments. The impact is limited to integrity and availability concerns, as attackers can manipulate displayed messages to mislead users, potentially leading to phishing or malware downloads via social engineering. Confidentiality is not directly affected. Organizations relying heavily on Git for Windows in shared or low-privilege user contexts may face increased risk. The low ease of exploitation and requirement for local write access reduce the overall threat level. However, given the widespread use of Git in software development across Europe, particularly in countries with strong IT sectors, the vulnerability could be leveraged in targeted attacks against developers or internal users. Disruption or misinformation in development workflows could have downstream effects on software quality and security.

Mitigation Recommendations

1. Upgrade all Git for Windows installations to version 2.40.1 or later, where the vulnerability is patched. 2. Restrict permissions on the root C:\ directory to prevent non-administrative users from creating folders, thereby blocking the attack vector. 3. Create an empty C:\mingw64 directory on Windows machines to preempt attacker folder creation. 4. Avoid using shared Windows accounts or multi-user environments where low-privilege users have write access to C:\. 5. Educate users and developers to be cautious of unexpected or unusual Git messages, especially those prompting external actions like visiting websites. 6. Implement endpoint monitoring to detect unauthorized folder creation in C:\ and suspicious file placements. 7. Integrate security awareness training focused on social engineering risks related to development tools. These steps go beyond generic advice by focusing on environment hardening and user behavior specific to this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2023-02-15T16:34:48.773Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 690a2ddcf0ba78a050535a98

Added to database: 11/4/2025, 4:46:20 PM

Last enriched: 11/4/2025, 4:49:17 PM

Last updated: 11/6/2025, 2:03:58 PM

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats