Skip to content
Path traversal Disclosed report Intermediate

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.

dawouw Follow

Originally disclosed on HackerOne

Bounty$250 High 7.0 View original
  • 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
GlassWire1.png
GlassWire1.png From the original on HackerOne
GlassWire2.png
GlassWire2.png

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

  • Wtsapi32.dll.dll
GlassWireU.png
GlassWireU.png From the original on HackerOne

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.

The original report as published on HackerOne, by dawouw. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Ensure at least one directory in the PATH environment variable is writable by the attacker.
  2. Place a malicious DLL with one of the expected names into that writable PATH directory.
  3. Start the GlassWire service (GWCtlSrv.exe) or wait for it to start at boot.
  4. 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.

More from GlassWire

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.