Fuzzing JavaScript Engines with Aspect-preserving Mutation

Soyeon Park, Wen Xu, Insu Yun, Daehee Jang, Taesoo Kim

Abstract

Modern JavaScript (JS) engines rely on complex Just-In-Time (JIT) compilers for performance, which have become the primary source of critical security vulnerabilities. Traditional fuzzers often fail to reach these deep logic bugs because their mutations disrupt the specific structures and types required to trigger JIT optimizations. This paper presents DIE (Dynamic Inference Engine), a fuzzer that employs "aspect-preserving mutation." By using a custom type system and a "Typed AST," DIE preserves the structural and semantic essence of seed inputs. Evaluation shows that DIE discovered 48 new high-impact bugs and 12 CVEs across major engines like V8 and ChakraCore, significantly outperforming existing state-of-the-art fuzzers.

The Evolving Landscape of JS Vulnerabilities

JavaScript engines have evolved into multi-stage pipelines consisting of parsers, interpreters, and multiple JIT compiler tiers. While early fuzzing efforts successfully eliminated many "shallow" bugs in parsers and interpreters, the focus of security research has shifted toward the JIT compiler.

Trends in JS engine vulnerabilities show a decrease in parser/interpreter bugs and a rise in complex JIT-related issues.

JIT compilers are notoriously difficult to fuzz because they only activate under specific conditions, such as loops executing with stable variable types. Existing generative fuzzers often lack the complexity to reach these states, while mutational fuzzers frequently "destruct" high-quality seeds by altering types or control flow, causing the engine to "bail out" of optimized execution and miss deep vulnerabilities.

DIE: Aspect-Preserving Mutation

To address these challenges, DIE introduces the concept of aspect-preserving mutation. The core idea is to modify code while stochastically maintaining the "aspects"—the specific structures and types—that allow the code to reach and stress the JIT compiler.

The DIE architecture includes pre-processing for type analysis, seed generation via aspect-preserving mutation, and a distributed execution platform.

Technical Components

  1. Typed AST: DIE operates on a version of the Abstract Syntax Tree where every node is annotated with type information.
  2. Hybrid Type Analysis: To populate the Typed AST, DIE uses dynamic analysis (running the seed once to observe runtime types) followed by static analysis (propagating types through the tree using predefined JS operation rules).
  3. Preservation Strategies:
    • Structure Preservation: DIE avoids deleting critical control-flow elements like loops that are essential for JIT triggering.
  4. Type Preservation: When replacing code snippets, DIE ensures the new code produces the same type as the original, preventing JIT de-optimizations.

Experimental Evaluation

DIE was evaluated using a corpus of 14,708 unique JavaScript files, including regression tests and known exploit PoCs. The fuzzer demonstrated superior performance compared to industry standards like Fuzzilli and CodeAlchemist.

Key Results

  • Bug Discovery: DIE identified 48 new bugs (28 in ChakraCore, 16 in JavaScriptCore, and 4 in V8).
  • Security Impact: These findings resulted in 12 assigned CVEs and $27,000 in bug bounties.
  • Efficiency and Validity: DIE found 5.7x more unique crashes than competitors and produced 2.4x fewer runtime errors, indicating a much higher quality of generated test cases.

Conclusion and Future Work

The success of DIE highlights that high-quality seeds are precious blueprints for reaching deep engine logic. By treating types as the "glue" that keeps JIT speculations valid, DIE effectively explores the most bug-prone regions of modern JS engines. Future work includes improving seed prioritization and expanding the type system's coverage of complex Web APIs.

Summary updated

BibTeX
@inproceedings{park2020fuzzing,
  author = {Soyeon Park and Wen Xu and Insu Yun and Daehee Jang and Taesoo Kim},
  title = {{Fuzzing JavaScript Engines with Aspect-preserving Mutation}},
  booktitle = {SP},
  year = {2020},
  doi = {10.1109/sp40000.2020.00067},
}
Figure