Uncontrolled Search Path Element allows DLL hijacking for priv esc to SYSTEM
GlassWire loads several DLL files from directories listed in the PATH environment variable without verifying their origin. An authenticated attacker who can write to any PATH directory could place a malicious DLL there, leading to code execution as SYSTEM when the GlassWire service starts.
- Fixed in 5 days
- Paid in 5 days
- Disclosed after 11 months
GlassWire contains a DLL hijacking vulnerability that could allow an authenticated attacker to execute arbitrary code on the targeted system. The vulnerability exists due to GlassWire loading DLL files from the PATH environment variable without verification. The machine should have at least one writable PATH directory for the privilege escalation to work (e.g. having Python, Java, etc. installed). Nine different DLL's are loaded by the GlassWire Service (GWCtlSrv.exe) as SYSTEM. One DLL is loaded by the GUI (GlassWire.exe) as the currently logged in user.
Class: Privilege Escalation [CAPEC-233] Class: Uncontrolled Search Path Element [CWE-427]
Affected Product GlassWire 2.2.210.0
Proof of Concept Usually, Python is prepended to the PATH environment (Path=C:\Python38\Scripts;C:\Python38;..). For my ease and workflow, I prepended my folder to it (C:\Dima;). Place the x86 DLL in one of the writable folder paths.
C:\Program Files (x86)\GlassWire\GWCtlSrv.exe GlassWire (32bit) loads the following DLLs during boot as SYSTEM:
- swift.dll
- CSUNSAPI.dll
- nfhwcrhk.dll
- SureWareHook.dll
- aep.dll
- nfhwcrhk.dll
- atasi.dll
- nuronssl.dll
- ubsec.dll


C:\Program Files (x86)\GlassWire\GlassWire.exe Glasswire GUI (32bit) loads the following DLL after user logon as the current user:
- Wtsapi32.dll.dll

I hope this helps. Please let me know if you require more information.
Kind regards, Dima van de Wouw Outflank
Impact
Successful exploitation of the GlassWire service allows an attacker to gain SYSTEM privileges and inject into the GlassWire service process at boot. Successful exploitation of the GlassWire GUI allows a user to gain persistence. On shared machines, this would allow a user to move laterally to sessions of other users.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could gain SYSTEM privileges and inject into the GlassWire service process at boot; for the GUI, a user could gain persistence and move laterally to other users' sessions on shared machines.
What the attacker needed
Authenticated attacker; at least one writable PATH directory; ability to place a DLL in that directory
How it was found
- Ensure at least one directory in the PATH environment variable is writable by the attacker.
- Place a malicious DLL with one of the expected names into that writable PATH directory.
- Start the GlassWire service (GWCtlSrv.exe) or wait for it to start at boot.
- The service loads the malicious DLL and executes it with SYSTEM privileges.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program starts, it often needs extra code stored in files called DLLs. Windows searches for these files in a set order, including folders listed in a system setting called PATH. If an attacker can put a fake DLL with the right name into one of those folders, the program will load it and run the attacker's code. Here, the GlassWire service runs with high privileges, so the fake DLL runs as SYSTEM, the most powerful Windows account.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.