Hello, @Lexikos. I'm opening this issue as advised by the AHK Discord mods.
AutoHotKey installer was found to have an untrusted search path vulnerability, since the installer is relying on the Windows default search order to load libraries. This could potentially allow an attacker to execute arbitrary code on a user's machine.
How to Reproduce (Proof of Concept)
Proof of concept worked on a Microsoft Windows 10 Home VM running version 10.0.19045 Build 19045 (with latest patches)
- Download AutoHotKey v2.0 installer from AutoHotKey's website.
- Create a custom DLL and name it
TextShaping.dll
- On the same folder where the installer was downloaded (i.e.
C:\Users\<username>\Downloads), drop the custom DLL
- Run the installer executable. The installer will fail due to calling the fake dll (since the required functions do not exist), but the custom DLL code will execute. Please note that you don't have to be an admin to have the installer execute the DLL, since the
TextShaping.dll DLL is loaded before you would get the UAC (User Account Control) prompt.
Remediation Steps
To fix this, Microsoft has multiple guidelines to perform safe DLL search order, such removing the current directory from the standard search path by calling SetDllDirectory
Please see below Microsoft's guidelines:
Hello, @Lexikos. I'm opening this issue as advised by the AHK Discord mods.
AutoHotKey installer was found to have an untrusted search path vulnerability, since the installer is relying on the Windows default search order to load libraries. This could potentially allow an attacker to execute arbitrary code on a user's machine.
How to Reproduce (Proof of Concept)
Proof of concept worked on a Microsoft Windows 10 Home VM running version 10.0.19045 Build 19045 (with latest patches)
TextShaping.dllC:\Users\<username>\Downloads), drop the custom DLLTextShaping.dllDLL is loaded before you would get the UAC (User Account Control) prompt.Remediation Steps
To fix this, Microsoft has multiple guidelines to perform safe DLL search order, such removing the current directory from the standard search path by calling SetDllDirectory
Please see below Microsoft's guidelines: