Mozilla enables W^X in Firefox 46 to improve security

Mozilla enabled the security feature W^X in Firefox Nightly (currently version 46) and plans to make it available to other versions of its web browser once they are upgraded to version 46.

W^X, spoken Write XOR Execute, is a security policy for memory that defines memory pages as either writable or executable, but not both. The feature is present in the OpenBSD operating system since 2003.

The OpenBSD base system has been modified to comply with it. This alleviates some buffer overflow attacks, including the most common stack-based attack: by ensuring that the stack is not executable, arbitrary code injected into it will not execute but instead cause the program to terminate

Most JIT (Just in Time) compilers use RWX (read-write-execute) permissions for memory pages which allows the compiler to patch code without performance overhead. This is the case for Firefox’s current JIT compiler, but also for Chrome’s or Safari’s compiler.

While that is beneficial to the browser’s performance while executing and running JavaScript code, it introduces issues at the same time.

mod apk

RWX Security

firefox 46 rwx

While most modern operating systems store code in executable but non-writable memory, RWX JIT code is an exception to this which makes it a target for attacks. In addition, memory corruption can be an issue as well.

Mozilla’s implementation of W^X makes all JIT code pages non-writable by default. If the browser needs to write to pages, a function needs to be called to explicitly make the page writable and remove the execute flag at the same time.

Once the write operation has been run, its permissions are changed to read and execute once again.

The developer responsible for the implementation notes that the introduction of the feature impacts performance while executing JavaScript code.

According to benchmark tests, Firefox loses less than 1% on modern benchmarks such as Kraken or Octane, and less than 4% on older benchmarks such as SunSpider. While a performance drop is measurable, it is not noticeable to users of the browser when JavaScript code is executed by it. (via Sören Hentzschel)


Article Name

Mozilla enables W^X in Firefox 46 to improve security


Mozilla enabled the security feature W^X in Firefox Nightly (currently version 46) to improve browser security while executing JavaScript code.

About Martin Brinkmann

Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook, Twitter or Google+

You are here: Home > Firefox > Mozilla enables W^X in Firefox 46 to improve security

This entry passed through the Full-Text RSS service – if this is your content and you’re reading it on someone else’s site, please read the FAQ at