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

Published Apr 20, 2023
·
Updated

A vulnerability was found in Git. This security flaw occurs when Git compiles with runtime prefix support and runs without translated messages, and it still uses the gettext machinery to display messages, which subsequently looks for translated messages in unexpected places. This flaw allows the malicious placement of crafted messages.

Other sources

CVE-2023-25815: When Git is compiled with runtime prefix support and runs without translated messages, it still used the gettext machinery to display messages, which subsequently potentially looked for translated messages in unexpected places. This allowed for malicious placement of crafted messages.

— Red Hat

GitHub: CVE-2023-25815 Git looks for localized messages in an unprivileged 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:\.

— MITRE

Affected Software

24 affected componentsFixes available
redhat/git<0:2.39.3-1.el8_8
0:2.39.3-1.el8_8
redhat/git<0:2.18.4-3.el8_1
0:2.18.4-3.el8_1
redhat/git<0:2.18.4-4.el8_2
0:2.18.4-4.el8_2
redhat/git<0:2.27.0-4.el8_4
0:2.27.0-4.el8_4
redhat/git<0:2.31.1-4.el8_6
0:2.31.1-4.el8_6
redhat/git<0:2.39.3-1.el9_2
0:2.39.3-1.el9_2
redhat/git<0:2.31.1-5.el9_0
0:2.31.1-5.el9_0
redhat/rh-git227-git<0:2.27.0-6.el7
0:2.27.0-6.el7
Microsoft Visual Studio 2019 (includes 16.0 - 16.10)=16.11
Microsoft Visual Studio 2017 (includes 15.0 - 15.8)=15.9
Git For Windows Project Git For Windows<2.40.1
Fedoraproject Fedora=37
Fedoraproject Fedora=38
Microsoft Visual Studio 2022=17.2
Microsoft Visual Studio 2022=17.4
Microsoft Visual Studio 2022=17.0
debian/git<1:2.39.5-0+deb12u1
1:2.39.5-0+deb12u1
debian/git<1:2.40.1-1
1:2.40.1-1
debian/git<1:2.40.1-1
1:2.40.1-1
debian/git
1:2.20.1-2+deb10u91:2.30.2-1+deb11u31:2.39.5-0+deb12u11:2.40.1-1
ubuntu/git<1:2.7.4-0ubuntu1.10+esm8
1:2.7.4-0ubuntu1.10+esm8
ubuntu/git<1:2.17.1-1ubuntu0.18
1:2.17.1-1ubuntu0.18
ubuntu/git<1:2.25.1-1ubuntu3.11
1:2.25.1-1ubuntu3.11
ubuntu/git<1:2.34.1-1ubuntu1.9
1:2.34.1-1ubuntu1.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.39.3-1.el8_8
  2. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.18.4-3.el8_1
  3. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.18.4-4.el8_2
  4. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.27.0-4.el8_4
  5. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.31.1-4.el8_6
  6. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.39.3-1.el9_2
  7. Upgrade

    Upgrade redhat/git to a version that resolves this vulnerability.

    Fixed in 0:2.31.1-5.el9_0
  8. Upgrade

    Upgrade redhat/rh-git227-git to a version that resolves this vulnerability.

    Fixed in 0:2.27.0-6.el7
  9. Upgrade

    Upgrade debian/git to a version that resolves this vulnerability.

    Fixed in 1:2.39.5-0+deb12u1
  10. Upgrade

    Upgrade debian/git to a version that resolves this vulnerability.

    Fixed in 1:2.40.1-1
  11. Upgrade

    Upgrade debian/git to a version that resolves this vulnerability.

    Fixed in 1:2.20.1-2+deb10u9Fixed in 1:2.30.2-1+deb11u3Fixed in 1:2.39.5-0+deb12u1Fixed in 1:2.40.1-1
  12. Upgrade

    Upgrade ubuntu/git to a version that resolves this vulnerability.

    Fixed in 1:2.7.4-0ubuntu1.10+esm8
  13. Upgrade

    Upgrade ubuntu/git to a version that resolves this vulnerability.

    Fixed in 1:2.17.1-1ubuntu0.18
  14. Upgrade

    Upgrade ubuntu/git to a version that resolves this vulnerability.

    Fixed in 1:2.25.1-1ubuntu3.11
  15. Upgrade

    Upgrade ubuntu/git to a version that resolves this vulnerability.

    Fixed in 1:2.34.1-1ubuntu1.9
  16. Upgrade

    Upgrade Git to a version that resolves this vulnerability.

    Fixed in 2.40.1
  17. Compensating control

    On Windows, avoid using shared accounts; alternatively create an empty C:\mingw64 folder. Administrators may instead remove users' permission to create folders in C:\

Event History

Apr 20, 2023
Data Sourced
01:51 PM
DescriptionSeverityAffected Software
Apr 25, 2023
CVE Published
12:00 AM
Data Sourced
12:00 AM
Remedy
Data Sourced
via OSV·05:00 PM
DescriptionSeverityAffected Software
CVE Published
via MITRE·07:51 PM
Data Sourced
07:51 PM
Weakness
Data Sourced
via MITRE·07:51 PM
DescriptionSeverityWeakness
Jun 26, 2023
Data Sourced
via Red Hat·06:13 PM
DescriptionSeverityAffected Software
Dec 27, 2023
Data Sourced
via NVD·10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·10:15 AM
Affected Software
Jun 26, 2024
Updated
via NVD·10:15 AM
Affected Software
Nov 21, 2024
Updated
via NVD·07:50 AM
RemedyAffected Software
Nov 4, 2025
Updated
via NVD·05:15 PM
RemedyAffected Software
Nov 2, 2026
Updated
via NVD·11:17 PM
Affected Software
Nov 3, 2026
Data Sourced
via OSV·10:30 AM
Weakness

Peer vulnerabilities

Found alongside the following vulnerabilities.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203