Microsoft Edge Remote Code Execution
Microsoft Edge did not properly sanitise custom URI schemes, allowing an attacker to pass arbitrary arguments to Windows Script Host and execute a malicious VBS script. By chaining path traversal and a vulnerable signed VBS script, an attacker could achieve remote code execution if the user accepted a prompt.
Published on leucosite.com
(CVE-2018-8495) Chaining a few bugs in Edge I was able to achieve remote code execution by mainly abusing custom URI schemes.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the browser failed to sanitise user-controlled input passed to custom URI scheme handlers, allowing path traversal and argument injection into Windows Script Host.
Impact
An attacker could execute arbitrary code on the victim's machine if the user accepted a prompt, but the exploit required user interaction and knowledge of the Windows build to locate the vulnerable script.
What the attacker needed
Victim uses Microsoft Edge; victim accepts prompt; attacker knows Windows build
The fix
The vulnerability was fixed by Microsoft, as indicated by the CVE and ZDI advisory.
How it was found
- Find a custom URI scheme that passes user input to an executable, such as 'wshfile' which invokes WScript.exe.
- Use path traversal in the URI to point to a known signed VBS script that accepts arguments and executes them.
- Craft the URI to inject arbitrary commands into the script's arguments.
- Trick the user into accepting the prompt by holding down the Enter key, which triggers the default OK button.
- The script executes the injected commands, achieving remote code execution.
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 write-up has not been written yet. The Original tab links to the source.
This report shows how a browser can be tricked into launching other programs on your computer with harmful instructions. The attacker used a special link that tells Windows to run a script, and because the browser didn't clean up the link properly, the script could run commands. The user had to click 'OK' on a prompt, but the attacker made that easy by holding down the Enter key.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.