# Local Privilege Escalation during execution of VeraCryptExpander.exe (UAC bypass)

VeraCryptExpander's elevated 'Homepage' button used ShellExecute, which resolves the URL handler from HKCU, letting a low-priv admin hijack it for UAC bypass.

- Payout: $1,250
- Severity: medium
- Program: Internet Bug Bounty
- Found by: penrose
- Disclosed: 2021-08-22
- CVE: CVE-2019-19501
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/530292
- Library page: https://bugbountylibrary.com/r/h1%3A530292
- Tags: area:os domain:desktop impact:integrity impact:privesc kind:bounty platform:hackerone sev:medium tech:windows technique:default-creds vuln:misconfiguration vuln:privilege-escalation

**Target:** VeraCryptExpander.exe (Windows desktop app, elevated process)
**Root cause:** Elevated process calls ShellExecute on an http URL; the URL protocol handler (ChromeHTML/IE.HTTP/HTTP etc.) is resolved from HKCU\Software\Classes, which a non-elevated user can write, so the handler command is attacker-controlled.
**Steps:**
1. As a limited admin, write HKCU\Software\Classes\HTTP\shell\open\command (and ChromeHTML/ChromeURL/FirefoxHTML/FirefoxURL/IE.HTTP/IE.HTTPS/HTTP/HTTPS variants) to `C:\Users\<user>\Desktop\malstaller.bat "%1"`.
2. On Win10, after tampering the keys, have the victim set the trapped browser (e.g. IE) as default so the handler resolves to the malicious command.
3. Launch VeraCryptExpander.exe and click the 'Homepage' button.
4. The elevated process invokes ShellExecute on the URL, which runs malstaller.bat with full admin rights.
5. Malicious script writes/replaces binaries under the VeraCrypt install folder and executes them elevated.
**How found:** Noticed the elevated process opens a web page via ShellExecute and that URL handler resolution trusts HKCU registry keys writable by the current user, then tested registry hijack of browser handlers on Win7/Win10.
**Exploitation:** Attacker with non-elevated admin writes HKCU URL-handler keys pointing to a malicious .bat, then waits for the victim to click the Homepage button in the elevated VeraCryptExpander; ShellExecute resolves the handler from HKCU and runs the script at high integrity, enabling tampering of the install directory and arbitrary elevated code execution.
**Escalation:** Elevated script can replace VeraCrypt binaries in the install folder, achieving persistent backdoor and full admin control.
**Insight:** Any elevated Windows process that calls ShellExecute/opens URLs or files by association is a UAC-bypass primitive: check whether the handler (HKCU\Software\Classes\<ProgID>\shell\open\command) is user-writable and can be redirected to an attacker script.

## Proof of concept (copied exactly from the original report)

**Registry keys hijacking browser handlers to malicious batch**

```
[HKEY_CURRENT_USER\Software\Classes\ChromeHTML\shell\open\command]
@="C:\Users\Temp\Desktop\malstaller.bat \"%1\""
```

**Windows 10 IE handler registry trap**

```
[HKEY_CURRENT_USER\Software\IE.HTTP\shell\open\command]
[HKEY_CURRENT_USER\Software\IE.HTTPS\shell\open\command]

With value:
"C:\Users{PLACE PROPER USER ACCOUNT NAME HERE}\Desktop\malstaller.bat" "%1"
```

