# 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) ([[raw/arxiv.org/from-formal-methods-to-fuzzing-and-back-donaldson-15394|Donaldson: Formal methods to fuzzing and back]]); xhack names it the main limit of AI fuzzing — logic bugs need explicit checks ([[raw/xhack.io/ai-fuzzing-where-ai-helps-and-what-the-evidence-shows-14699|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 ([[raw/offsecblog.com/mishegos-for-differential-fuzzing-of-x86-instruction-decoders-13804|mishegos]]); runtimes that enforce file rights differently break sandbox assumptions ([[raw/runtimeverification.com/sandboxing-ai-agents-with-wasm-ai-assisted-differential-fuzzing-of-was-15713|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 ([[raw/runtimeverification.com/sandboxing-ai-agents-with-wasm-ai-assisted-differential-fuzzing-of-was-15713|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 ([[raw/offsecblog.com/mishegos-for-differential-fuzzing-of-x86-instruction-decoders-13804|mishegos]]). - **Wasm runtimes:** `wasm-tools mutate --seed N in.wasm -o out.wasm` produces semantics-preserving variants; a `libfuzzer-sys` harness executes in Wasmtime in-process and the second runtime (Wasmer/WAMR) **via subprocess** to dodge `wasmparser` diamond-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 ([[raw/fuzze.rs/fuzzing-webassembly-wasmtime-wasm-mutate-and-cross-runtime-differentia-15715|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 ([[raw/runtimeverification.com/sandboxing-ai-agents-with-wasm-ai-assisted-differential-fuzzing-of-was-15713|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 an `ArithmeticException` in Johnzon on `1e1000000`, a Parsson `skipObject()`/`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 ([[raw/christoph-sens.com/what-the-test-suite-does-not-find-hardening-a-jsonpath-library-with-fu-13951|Treetrail hardening]]). Why it matters: attacker-controlled JSONPath regex already produced ReDoS in Symfony (CVE-2026-45756, `(a+)+
beat PHP's backtrack limit) ([[raw/daubois.dev/cve-2026-45756-attacker-controlled-regex-in-symfony-jsonpath-filters-r-12076|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 ([[raw/asknau.com/i-fuzzed-the-open-ice40-toolchain-at-bitstream-level-15716|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 ([[raw/usenix.org/buizz-finding-browser-policy-enforcement-bugs-via-ui-interaction-simul-15903|BUIzz]]). ## Related - [[Fuzzing]] - [[Coverage-Guided Fuzzing]] - [[LLM-Assisted Fuzzing]] - [[URL Parser Differentials]] - [[Fuzzing Harness Design]] ## Sources - [[raw/arxiv.org/from-formal-methods-to-fuzzing-and-back-donaldson-15394|From Formal Methods to Fuzzing and Back (Donaldson)]] - [[raw/xhack.io/ai-fuzzing-where-ai-helps-and-what-the-evidence-shows-14699|AI fuzzing: where AI helps and what the evidence shows]] - [[raw/offsecblog.com/mishegos-for-differential-fuzzing-of-x86-instruction-decoders-13804|mishegos for differential fuzzing of x86 instruction decoders]] - [[raw/fuzze.rs/fuzzing-webassembly-wasmtime-wasm-mutate-and-cross-runtime-differentia-15715|Fuzzing WebAssembly: Wasmtime, wasm-mutate and cross-runtime differential testing]] - [[raw/runtimeverification.com/sandboxing-ai-agents-with-wasm-ai-assisted-differential-fuzzing-of-was-15713|Sandboxing AI Agents with Wasm: AI-assisted differential fuzzing of WASI]] - [[raw/christoph-sens.com/what-the-test-suite-does-not-find-hardening-a-jsonpath-library-with-fu-13951|What the test suite does not find: hardening a JSONPath library with fuzzing]] - [[raw/daubois.dev/cve-2026-45756-attacker-controlled-regex-in-symfony-jsonpath-filters-r-12076|CVE-2026-45756: attacker-controlled regex in Symfony JsonPath filters (ReDoS)]] - [[raw/asknau.com/i-fuzzed-the-open-ice40-toolchain-at-bitstream-level-15716|I fuzzed the open iCE40 toolchain at bitstream level]] - [[raw/usenix.org/buizz-finding-browser-policy-enforcement-bugs-via-ui-interaction-simul-15903|BUIzz: finding browser policy enforcement bugs via UI interaction simulation (USENIX Sec 2026)]]