# Uncontrolled Search Path Element allows DLL hijacking for priv esc to SYSTEM

GlassWire service loads nine DLLs from writable PATH directories as SYSTEM, letting a local user plant a malicious DLL to escalate to SYSTEM.

- Payout: $250
- Severity: high
- Program: GlassWire
- Found by: dawouw
- Disclosed: 2021-06-04
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/921675
- Library page: https://bugbountylibrary.com/r/h1%3A921675
- Tags: area:os domain:desktop impact:integrity impact:privesc kind:bounty platform:hackerone sev:high tech:windows technique:recon vuln:privilege-escalation

**Target:** GlassWire 2.2.210.0 (GWCtlSrv.exe service and GlassWire.exe GUI)
**Root cause:** GWCtlSrv.exe and GlassWire.exe load DLLs by name without full path verification, so the Windows loader resolves them via the PATH environment variable, which may include user-writable directories.
**Steps:**
1. Ensure at least one PATH directory is writable (e.g. Python/Java install dirs, or prepend `C:\Dima\` to PATH).
2. Place a malicious x86 DLL named `swift.dll` (or any of: CSUNSAPI.dll, nfhwcrhk.dll, SureWareHook.dll, aep.dll, atasi.dll, nuronssl.dll, ubsec.dll) in the writable PATH folder.
3. Reboot; GWCtlSrv.exe loads the DLL as SYSTEM, executing attacker code.
4. For GUI persistence, place `Wtsapi32.dll.dll` in a writable PATH dir; GlassWire.exe loads it at user logon.
**How found:** Researcher inspected DLL load behavior of GlassWire binaries, enumerated DLLs resolved from PATH, and identified writable PATH directories (e.g. Python install path) enabling hijack.
**Exploitation:** Local authenticated attacker writes a crafted DLL into a writable PATH directory; on boot the SYSTEM service loads it, granting SYSTEM code execution and process injection into GWCtlSrv.exe. GUI variant gives persistence and cross-session lateral movement on shared hosts.
**Escalation:** Chaining service DLL hijack (SYSTEM) with GUI hijack (persistence/lateral movement across user sessions).
**Insight:** Enumerate DLL imports of privileged Windows services and check whether any resolve via PATH rather than System32/app dir; writable PATH entries from dev tooling (Python, Java) are common hijack vectors.

