AddressSanitizer: heap-use-after-free [@ EntryCount] using toggle responsive design mode (ctrl+shift+m)
A crafted HTML page caused a heap-use-after-free in Firefox's hash table code when the user toggled Responsive Design Mode. The tab crashed, which an attacker could use to disrupt the browser session.
Originally disclosed on Mozilla
- Fixed in 11 days
- Paid in 18 days
- Disclosed after 11 days
Created attachment 9210438 testcase.html
After visit the testcase, when toggling the responsive design mode, the tab crashed with summary: AddressSanitizer: heap-use-after-free /builds/worker/workspace/obj-build/dist/include/PLDHashTable.h:434:40 in EntryCount.
Affected version:
- Firefox Nightly 88.0a1 (2021-03-19) (64-bit)
- Firefox Release 86.0.1 (64-bit)
- Firefox ESR 78.8.0esr (64-bit)
Steps to Reproduce:
- Visit attached testcase.html
- Press
Ctrl+Shift+Mto switch to Responsive Design Mode - After ~5 seconds the page will reload itself
- After the page reload, press
Ctrl+Shift+Mto exit the Responsive Design Mode - The tab crashed
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 a hash table entry was freed while still referenced during the responsive design mode reload, leading to a use-after-free in EntryCount.
Impact
The tab crashed, which could let an attacker disrupt the browser session; the report does not claim code execution.
What the attacker needed
Victim opens a crafted page; victim toggles Responsive Design Mode
How it was found
- Open the provided test case page.
- Press Ctrl+Shift+M to enter Responsive Design Mode.
- Wait about five seconds for the page to reload itself.
- Press Ctrl+Shift+M again to exit Responsive Design Mode.
- The tab crashes.
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.
A use-after-free is a memory bug where a program keeps using a piece of memory after it has been freed, so the data there can be wrong or controlled by someone else. Here a specially made web page plus a keyboard shortcut for a developer tool made Firefox read freed memory and crash the tab.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.