Differential Fuzzing
Feeding the same generated input to two or more implementations of one specification (or to one implementation before and after a transformation) and treating any observable disagreement as a bug signal — an oracle for logic and semantic bugs that never crash.
How it works
- The oracle problem. A crash-only fuzzer cannot recognize a wrong answer; differential testing substitutes “implementations disagree” for a specification of correctness. Donaldson traces the oracle problem as the link between formal methods and fuzzing (GraphicsFuzz) (Donaldson: Formal methods to fuzzing and back); xhack names it the main limit of AI fuzzing — logic bugs need explicit checks (xhack).
- Security relevance. Disagreement between a component that validates and one that acts is the root of parser-differential bugs: decoders that read an x86 prefix differently blind analysts’ tooling (mishegos); runtimes that enforce file rights differently break sandbox assumptions (Runtime Verification: WASI). The web analogue is URL Parser Differentials.
- Trust model for AI-written fuzzers. Differential setups don’t require trusting the model’s reading of the spec: a divergence between two independent engines is evidence by itself (Runtime Verification).
Techniques
Multi-implementation
- x86 decoders (mishegos): run Capstone-class disassemblers, emulator decoders (Unicorn) and symbolic-execution lifters over the same byte stream; disagreements on prefixes, VEX/EVEX or REX expose decoder bugs (mishegos).
- Wasm runtimes:
wasm-tools mutate --seed N in.wasm -o out.wasmproduces semantics-preserving variants; alibfuzzer-sysharness executes in Wasmtime in-process and the second runtime (Wasmer/WAMR) via subprocess to dodgewasmparserdiamond-dependency conflicts. Any difference in return value or accept/reject is a bug; stage-4-but-unshipped proposals (SIMD, GC/reference types, tail calls, memory64) are where divergence concentrates (fuzze.rs: Wasm differential). An earlier Runtime Verification campaign found a WAMR null-reference bug this way. - WASI filesystem: a Claude Code–built generator emitted random sequences of WASI calls (open with flag/rights combos, write, seek, rename, mkdir,
../symlink escapes) against Wasmtime and WasmEdge. Both blocked traversal; but opening with create + read-only inside a writable preopen returned a writable handle on one engine — the spec is ambiguous and even Wasmtime maintainers opened a spec issue. Impact: a trusted broker that hands a “read-only” handle to an untrusted agent plugin may be handing out write access (Runtime Verification). - JSONPath: Treetrail (passes all 715 RFC 9535 compliance cases) diffs its non-backtracking regex automaton against
java.util.regex(20,000 random patterns,match()/search()), diffs 2,000 random queries (one in seven deliberately malformed) against an independent Python RFC 9535 implementation, and ran 14.4M generated queries against Parsson/Johnzon variants — surfacing anArithmeticExceptionin Johnzon on1e1000000, a ParssonskipObject()/skipArray()bug open since 2020, and a compliance-suite error on regex anchors. Mutation testing (PIT, 1,399 mutants, 87% killed, nightly fails <85%) checks the tests themselves (Treetrail hardening). Why it matters: attacker-controlled JSONPath regex already produced ReDoS in Symfony (CVE-2026-45756,(a+)+$beat PHP’s backtrack limit) (Symfony JsonPath ReDoS).
Equivalence (before vs after a transformation)
FPGA toolchains: 400 random designs through yosys → nextpnr-ice40 → icepack; the netlist is recovered from the final .bin (iceunpack → icebox_vlog) and a SAT miter proves equivalence with the source. All equivalent, every logic-changing mutant caught — but the author’s own checker failed twice first, caught only by negative controls (compare against a different design, which must fail). FUZNET’s Vivado run (57,316 netlists, ~3.3% inequivalent) reduced to two real P&R bugs (iCE40 bitstream fuzzing).
Pitfalls
- Implementations sharing ancestry aren’t independent (Treetrail’s JSON-P variants descend from Treetrail) — expect correlated blind spots.
- Spec ambiguity yields “both right” divergences; triage needs the spec, and sometimes a spec change (WASI).
- Validate the oracle itself with negative controls and mutation testing.
- Cross-implementation oracles get expensive when the input space multiplies (every page × every UI interaction) and miss bugs all implementations share. BUIzz swaps in a pre/post oracle inside one browser: the same test page’s policy enforcement before vs after a UI interaction (BUIzz).
Related
- Fuzzing
- Coverage-Guided Fuzzing
- LLM-Assisted Fuzzing
- URL Parser Differentials
- Fuzzing Harness Design
Sources
- From Formal Methods to Fuzzing and Back (Donaldson) · original
- AI fuzzing: where AI helps and what the evidence shows · original
- mishegos for differential fuzzing of x86 instruction decoders · original
- Fuzzing WebAssembly: Wasmtime, wasm-mutate and cross-runtime differential testing · original
- Sandboxing AI Agents with Wasm: AI-assisted differential fuzzing of WASI · original
- What the test suite does not find: hardening a JSONPath library with fuzzing · original
- CVE-2026-45756: attacker-controlled regex in Symfony JsonPath filters (ReDoS) · original
- I fuzzed the open iCE40 toolchain at bitstream level · original
- BUIzz: finding browser policy enforcement bugs via UI interaction simulation (USENIX Sec 2026) · original