DLL Hijacking via webauthn.dll
The Firefox Windows build attempted to load a missing DLL named webauthn.dll from directories in the user's PATH and from a user-writable WindowsApps folder. An attacker with local access could place a malicious DLL there to execute code and maintain persistence.
Originally disclosed on Mozilla
- Fixed in 9 days
- Paid in 21 days
- Disclosed after 9 days
Created attachment 9153184
Procmon Output after installing Firefox
A DLL hijacking vulnerability was found in the Firefox Windows version. An attacker that obtained access to the victim system would be able to use this vulnerability to maintain persistence or evade defences.
More specifically, the webauthn.dll DLL was found to be missing and it was possible to hijack it by creating a DLL with the same name in one of the directories within the %PATH% variable.
Additionally, just right after the installation process, the process firefox.exe was looking in the %APPDATA%\Local\Microsoft\WindowsApps directory for the aforementioned DLL (see attached screenshot). The directory is usually writable by the current user and it's outside the %PATH% variable, meaning that even without ACL misconfiguration (being able to write in a folder within the %PATH%) it would still be possible to execute code in this way.
This was tested with Firefox version 76.0.1
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
Root cause
Likely the application loaded a DLL by name without ensuring it came from a trusted, non-user-writable location, allowing a malicious DLL in the search path to be loaded.
Impact
An attacker who already has access to the victim system could execute code in the context of Firefox, potentially maintaining persistence or evading defences.
What the attacker needed
Local access to the victim Windows system; ability to write to a DLL search directory
How it was found
- Install Firefox on Windows.
- Observe with Procmon that firefox.exe searches for webauthn.dll.
- Note that the DLL is missing and that search includes user-writable directories such as %APPDATA%\Local\Microsoft\WindowsApps.
- Place a DLL named webauthn.dll in such a directory to achieve 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 report has not been written yet. The Original tab links to the source.
When a program starts, Windows looks for supporting library files (DLLs) in several folders. If a program asks for a DLL that is not present, an attacker who can write to one of those folders can supply their own file, and the program will run it. Here, Firefox looked for a missing DLL in places a normal user can write to, so a local attacker could get their code running inside Firefox.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.