TL;DR
WEAVER is a novel greybox fuzzing framework designed to uncover security vulnerabilities at the interaction boundary between JavaScript (JS) and WebAssembly (Wasm) inside modern web browsers. By maintaining a dual-type representation for variables and using a multi-armed bandit algorithm for smart mutation scheduling, WEAVER successfully uncovers critical cross-language bugs that traditional, single-language fuzzers completely miss.
What Problem Does This Paper Address?
Modern JavaScript engines (like Google’s V8, Mozilla’s SpiderMonkey, and Apple’s JavaScriptCore) are no longer single-language environments. The integration of WebAssembly has turned them into complex polyglot runtimes where dynamically typed, garbage-collected JS code seamlessly interacts with statically typed, linear-memory Wasm binaries.
This interaction boundary introduces a massive, underexplored attack surface. Bugs often lurk not within JS or Wasm individually, but in the complex data and control flows passing between them. Existing fuzzers fail here: JS fuzzers are blind to Wasm semantics, while Wasm fuzzers typically use simple, static JS wrappers that fail to trigger deep, cross-language engine logic (such as Just-In-Time compilation or debugging interfaces).
The authors identify two main challenges in fuzzing this boundary:
- Dual-Language Validation Rules: Generated test cases must simultaneously satisfy the strict, distinct semantic rules of both JS and Wasm to avoid premature runtime errors.
- Combinatorial Explosion: The combined feature space of both languages makes exploring rare or complex interactions incredibly difficult without smart guidance.
Methods
WEAVER builds upon the state-of-the-art JS fuzzer, Fuzzilli, introducing three core components to bridge the JS-Wasm divide:
- Dual-Type Analyzer & Static Type Environment: To ensure semantic validity across the boundary, WEAVER tracks both the JS and Wasm type annotations for every generated variable. It uses predefined conversion rules to safely map types between the two domains.
- Decoupled Wasm-Specific Generation: Instead of generating full Wasm binaries from scratch, WEAVER uses a delegation-based design. It generates the abstract "shape" (imports and exports) of a Wasm module to establish cross-language connections and delegates the actual binary generation to
wasm-smith, a third-party tool. - Performance-Based Scheduler: To combat the combinatorial explosion of inputs, WEAVER models the fuzzing process as a multi-armed bandit problem. It leverages the UCB-1 algorithm to dynamically adjust the selection weights of generators and mutators based on how effectively they produce valid, non-timeout test cases.
Datasets
As a fuzzing framework, WEAVER does not use traditional machine learning datasets. Instead, it was evaluated directly against the latest production builds of three mainstream JS engines:
- Apple JavaScriptCore (Safari)
- Google V8 (Chrome/Node.js)
- Mozilla SpiderMonkey (Firefox)
The framework utilized wasm-smith as an underlying utility to synthesize valid Wasm modules matching WEAVER's generated specifications.
Key Insights and Ideas
- The "Polyglot" Vulnerability Reality: Real-world bugs often require a chain of cross-language interactions (e.g., JS calling Wasm, which calls a JS function that invokes a browser debugger API). Testing either language in isolation leaves these critical paths blind.
- The Danger of Static Weights: In polyglot fuzzing, assigning fixed weights to code generators leads to "timeout explosions." Because Wasm objects (like large Tables or Memories) are resource-heavy, a fuzzer without dynamic scheduling will over-generate them, wasting valuable CPU cycles on timeouts.
- Unified Type Tracking is Essential: By labeling variables with a dual-type representation, the fuzzer can seamlessly query the context for variables that satisfy Wasm constraints while remaining valid in a JS execution context.
Key Results
WEAVER was evaluated in a 72-hour head-to-head comparison against baseline fuzzers (including standard Fuzzilli and Dharma):
- Superior Code Coverage: WEAVER consistently outperformed all baselines across all three engines, achieving up to a 9.4% increase in branch coverage compared to the early version of Fuzzilli.
- Real-World Impact: In a long-term fuzzing campaign, WEAVER discovered two new real-world bugs in the latest engine versions.
- An Out-of-Bounds (OOB) memory read in JavaScriptCore.
- A critical, high-severity assertion failure in SpiderMonkey (affecting riscv64 and arm64 architectures) that could enable arbitrary code execution. The authors were awarded $1,000 in bug bounties for these findings.
Limitations and Future Work
Despite its success, the authors note several areas for improvement:
- Runtime vs. Static Validation: While
wasm-smithguarantees that generated Wasm modules pass static validation, it cannot predict runtime behaviors, occasionally leading to unavoidableRuntimeErrorexceptions during execution. - Lack of Value Tracking: WEAVER currently does not track the specific values of integer variables. This can cause
LinkErrororTypeErrorwhen JS integers exceed the 31-bit range expected by certain Wasm reference types. - Type Imprecision: Imprecisions inherent to Fuzzilli's native JS type system (such as conflating
nullandundefinedunder a singlenullishtype) propagate into WEAVER's inferred Wasm types, occasionally causing type mismatches.
Summary updated