Skip to content

Git for Windows' uninstaller vulnerable to DLL hijacking when run under the SYSTEM user account

Low
vdye published GHSA-gf48-x3vr-j5c3 Apr 12, 2022

Package

git-for-windows (-)

Affected versions

<=2.35.1.2

Patched versions

v2.35.2

Description

Impact

Since part of Git for Windows' uninstaller is copied into the current user's temporary directory and run in that place, it is important to ensure that there are no malicious .dll file in that directory that might be loaded as part of loading the executable.

However, the default system settings for TMP and TEMP are to point to C:\Windows\Temp, a folder that is world-writable (for historical reasons), and the SYSTEM user account inherits those settings. This means that any authenticated user can place malicious .dll files that are loaded when Git for Windows' uninstaller is run via the SYSTEM account.

Patches

Fixes are available in Git for Windows v2.35.2 or newer.

Workarounds

  • Override SYSTEM's TMP environment variable to point to a directory exclusively under SYSTEM's control before running the uninstaller
  • Sweeping C:\Windows\Temp of all .dll files before running the uninstaller
  • Running the uninstaller under an admin account rather than SYSTEM

Credits

Thank you Lockheed Martin Red Team for finding and reporting this vulnerability!

References

For more information

CVSS v3.1 Vector AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N/E:P/RL:T/RC:C/CR:X/IR:X/AR:X/MAV:L/MAC:H/MPR:L/MUI:R/MS:U/MC:H/MI:H/MA:N

If you have any questions or comments about this advisory:

Severity

Low

CVE ID

CVE-2022-24767

Credits