A single RWX page is getting allocated on Windows
Firefox on Windows allocates one or two 4 KB pages with read, write and execute permissions, which breaks the browser's W^X/DEP protection. An attacker who can write to such a page could run code from it.
Originally disclosed on Mozilla
- Fixed in 3 months
- Paid in 4 months
- Disclosed after 3 months
On Windows, I frequently see a single RWX ("Execute/Read/Write") 4k block (a single page). Occasionally I see two. This was observed with both Firefox Nightly and Release. This violates Firefox's W^X/DEP protection.
STR:
1. Download VMMap (https://technet.microsoft.com/en-us/sysinternals/vmmap.aspx) and run it.
2. Choose File > Select Process... > Launch and Trace a New Process > Application and select firefox.exe
3. Look at the "Details" block (bottom half of the VMMap window) and sort by "Protection". One or two "Execute/Read/Write" blocks of 4k each are typically visible.
(I have tried to click the "Heap Allocations..." button to examine the RWX page's allocation call stack, but the button remains disabled. I don't know why.)
Desired result:
No "Execute/Read/Write" blocks should be produced.
Also, it would be nice to add an automated test that detects such RWX blocks in the future.
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 code path in Firefox or a third-party component allocates a page with PAGE_EXECUTE_READWRITE instead of using separate writable and executable pages.
What the attacker needed
Windows operating system; Firefox Nightly or Release; VMMap tool
How it was found
- Download and run VMMap.
- Choose File > Select Process... > Launch and Trace a New Process > Application and select firefox.exe.
- Look at the Details block, sort by Protection, and observe one or two Execute/Read/Write blocks of 4k.
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.
Normally a program's memory pages are either writable or executable, not both, so that an attacker who can write data cannot also run it as code. This report shows Firefox on Windows sometimes creates a page that is both writable and executable, which weakens that protection.
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.