Mohabi: Disaggregating and Sandboxing the Firefox JavaScript Engine

Featured image

Topic

JavaScript Engine sandboxing


Problem: JavaScript Engine is not safe

Critical Memory safety vulnerablilities

Causes

  1. Java script Engine & its’inputs are complex -> large attack window.
  2. Memory safety bugs are in runtime-generated code -> dynamic & realtime ex) JavaScript JIT produce code without bound check

Solution

Then let’s sandbox the JS engine

Prior works

  1. Academic work / don’t support full browser(NaCIJIT, RockJIT, NoJITsu): Don’t handle the complexity of integration with JS engines in production browsers.
  2. Industry work / frequently bypassed
    • Partially sandbox JS engine (Ubercage): positive assumption for safety -> Larger attack window.
    • Partial mitigation (JITCage) : selectively apply some SFI techniques -> protections are bypassable

Goal

Fully sandbox JS engine in the site’s process with Software-based Fault Isolation


Challenge & Solution

1. How to seperate JS engine from FireFox?

There is a common pattern in control flow & data sharing -> develop tools to handle (implementation)

2. How to ensure correct workflow /while memory isolation for JS engine?

3. How to keep overhead low /while sandboxing entire JS engine

Develop good SFI toolchain: MH-LFI

4. How to keep engineering cost low /while sandboxing entire JS engine?


Thoughts & Questions

1. Isn’t it just a trade off between security <-> overhead? @

Isn’t the reason why prior work with partial security tools for ensure lower overhead?

2. How does isolate memory for JS engine? static? or dynamic?

if static then -> what if there is dynamic requirement fluctuation the memory is needed by JS engine? if allocate conservatively, it would be waste. if dynamic then -> Does memory space isolation would work well, even when memory isolation size should be changed dynamically?


Input