Fuzzing

Automated generation of unexpected inputs against a target while an oracle (sanitizer, crash, hang, invariant, or a second implementation) watches for misbehaviour. It is the highest-yield dynamic technique for memory-safety, parser and protocol bugs, and increasingly finds logic bugs when paired with LLM agents.

What it is

  • Scope. Fuzzing covers native libraries and binaries (Coverage-Guided Fuzzing), file formats, languages and protocols (Grammar-Based Fuzzing), kernels, drivers and firmware (Kernel Fuzzing), semantic bugs with no crash (Differential Fuzzing), HTTP surfaces (Web Fuzzing, API Fuzzing) and smart contracts. Mutation-based evolutionary fuzzing is the de facto algorithm (Testing Handbook).
  • Why it matters. Continuous fuzzing is now routine: OSS-Fuzz fuzzes 1,300+ projects for free. Ada Logics’ 115-project integration produced 2,104 bugs, 559 of them security-relevant (Ada Logics). Enrollment is not coverage, though: GStreamer sat at 2 fuzzers and ~19% coverage for seven years, and GHSL then found 29 vulns in it (GitHub Security Lab).
  • Where the yield is now:
    • reaching state the existing harness never builds (valid gz* objects, nested MP4 atoms, TCP state, SMB sessions);
    • adding oracles for silent bug classes (Go integer overflow, Jazzer’s SSRF and command-injection detectors, invariants, differentials);
    • covering what continuous fuzzing skipped (un-instrumented dependencies, broken builds, low-coverage projects).
  • Attackers have the same tools. Trail of Bits says the expertise barrier to bespoke fuzzing “is gone” (Trail of Bits).

Core concepts

  • Taxonomy. Fuzzers are blackbox, greybox (coverage-guided) or whitebox (symbolic/concolic), and either mutation-based or generation-based (Better Stack). Coverage-guided fuzzing suits self-contained, deterministic, fast targets such as binary format parsers. Blackbox suits large, slow or non-deterministic targets such as browser DOM fuzzers (ClusterFuzz).
  • Components. A campaign has a SUT, harness, engine, corpus/seeds, dictionary, mutators, feedback and oracle. The design space of a custom fuzzer (corpus kinds, arithmetic/bitmask/token mutations, block/branch/path coverage feedback) is laid out in raminfp’s Rust notes (fuzzer-development-with-rust).
  • Feedback loop. The engine mutates a corpus entry, runs it and reads the coverage map. Any input that hits an unseen edge is kept. AFL calls this an “instrumentation-guided genetic algorithm” (AFL). Instrumentation comes from LLVM SanitizerCoverage (-fsanitize=fuzzer), AFL++ LTO/QEMU, KCOV in the kernel, or a hypervisor → Coverage-Guided Fuzzing, Kernel Fuzzing.
  • Oracles. Coverage finds paths, but sanitizers (ASan, UBSan, MSan) are what turn memory errors into crashes. Without them most corruption is silent. Other oracles:
    • language-specific detectors (Jazzer’s SSRF, path-traversal and command-injection sanitizers; go-panikint’s overflow panics);
    • invariant asserts in the harness (Fuzzing Harness Design);
    • implementation-vs-implementation disagreement (Differential Fuzzing);
    • response diffs against a baseline (Web Fuzzing).
  • Harness. The harness is the glue from fuzzer bytes to target API calls, or to a restored process/VM snapshot. Its scope and statefulness decide what is reachable and whether crashes are real → Fuzzing Harness Design.
  • Structure. Byte mutation stalls on nested or length-prefixed formats and on stateful protocols. Structure-aware fuzzing escalates from dictionaries to FuzzedDataProvider, custom mutators, protobuf, and full grammars (Testing Handbook: harnesses) → Grammar-Based Fuzzing.
  • Division of labour with LLMs. “The LLM agent owns the decisions, and the MCP tools own the execution” (GHSL Taskflow). The model drafts harnesses, seeds, build fixes and triage. The fuzzer does the search (xhack) → LLM-Assisted Fuzzing.

How to approach it

  1. Pick the target and the oracle. Use this table to choose a starting point.

    TargetStart with
    C/C++ library with sourcelibFuzzer harness + AFL++ (LTO, CMPLOG) + ASan/UBSan → Coverage-Guided Fuzzing
    Closed-source binaryAFL++ QEMU persistent mode, Unicorn or a snapshot fuzzer (wtf, Nyx) if startup is heavy
    Nested or structured formatCustom mutator or grammar → Grammar-Based Fuzzing
    Network protocol or stateful targetFandango, boofuzz, InterceptFuzz, LibAFL-QEMU snapshots, ChatAFL
    Kernel subsystem or driversyzkaller + syzlang (KernelGPT for specs) → Kernel Fuzzing
    Wrong answers that never crashDifferential or invariant oracles → Differential Fuzzing
    Web app or APIWeb Fuzzing, API Fuzzing, Content Discovery
    Smart contractMedusa, Echidna, Wake 5
    Unfuzzed OSS projectLLM harness synthesis + evidence gate → LLM-Assisted Fuzzing

    Before fuzzing existing OSS, check the target’s OSS-Fuzz coverage and fuzzer count, and whether its dependencies are instrumented. Gaps there are where bugs survived (GHSL).

  2. Build for fuzzing. Use sanitizer builds (ASan, UBSan, and MSan separately). Add a CMPLOG build for AFL++. Gate checksums and CPU-heavy checks behind FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION. Stub network and DB dependencies (SRLabs).

  3. Write the harness. Start from the function the library’s own examples use and map fuzz data to its parameters. Free resources on every path and iterate on coverage (SRLabs: beginner's guide). Construct valid state first, then mutate inside it → Fuzzing Harness Design.

  4. Seed and shape the input. Use seeds from edge-case tests and a per-format dictionary. Minimize the corpus with afl-cmin or -merge=1. Add a custom mutator or grammar when coverage plateaus at the parser.

  5. Run in parallel and watch coverage. Run one AFL++ primary, several secondaries, and 1–2 CMPLOG and 1–3 laf-intel instances (AFL++ in depth). Check stability, read LCOV gaps and fix the harness rather than waiting. On a plateau, consider hybrid concolic fuzzing (SymSan, Sydr) or periodic empty-corpus restarts.

  6. Triage. Minimize the crash (afl-tmin, -minimize_crash=1), replay it against an ASan build, and group by ASan summary. Decide whether the harness or the project owns the bug. Then prove reachability from a real entry point (libming: 177 crashes to one root cause).

  7. Close the loop. Write the root cause, fix and variant analysis. Keep the corpus and crashers as regression tests, and run short fuzz jobs in CI (binaryexploitation.org).

Key techniques

  • Coverage-guided fuzzing → Coverage-Guided Fuzzing.
    • AFL++. Compile with afl-clang-lto on LLVM 11+. CMPLOG/RedQueen solves magic values; laf-intel splits comparisons. Persistent mode gives a x2–x20 speedup.
    • Binary-only targets. QEMU mode (-Q) runs at a 2–5x slowdown. AFL_QEMU_PERSISTENT_ADDR is the biggest exec-rate lever. Without AFL_QEMU_PERSISTENT_HOOK to copy the input in, you get “full speed, zero coverage growth” (AFL++ QEMU mode).
    • Binary-only on device (LibAFL Frida mode). Frida Stalker recompiles only the target library’s basic blocks with AFL-style edge coverage, CmpLog and optional binary ASan, in-process and without root (shell user in /data/local/tmp). On an unrooted Galaxy S25 it ran ~6k exec/s per core, ~30k on eight, against the real bionic, linker namespace and Scudo allocator; the target must be mapped before FridaInstrumentationHelper is built or coverage is 0% (Mobile Hacking Lab).
    • Managed languages. Each has an engine: cargo-fuzz (Rust), gosentry/go-panikint (Go), Jazzer (JVM), Jazzer.js (Node), Atheris (Python), Ruzzy+LibAFL (Ruby).
    • Hybrid concolic. SymSan + input-to-state beat CmpLog on throughput in 13/15 targets (SymSan vs CmpLog).
  • Harness design → Fuzzing Harness Design.
    • SRLabs rules. Don’t reuse or reinterpret input bytes, keep state between iterations, or do I/O. Do check minimum length, use FuzzedDataProvider, assert invariants, and put one-time init in LLVMFuzzerInitialize().
    • Snapshot harnesses. Use these when startup is long or non-deterministic: Nyx+HyperHook, wtf, Unicorn-AFL, LibAFL-QEMU incremental snapshots, or WinPE booted from RAM.
  • Structure-aware and grammar fuzzing → Grammar-Based Fuzzing.
    • Partially structure-aware mutators. Atredis’s MP4 mutators fix ancestor atom sizes only 50% of the time, so malformed-length paths stay reachable (Atredis).
    • Protobuf on binaries. libprotobuf via AFL_CUSTOM_MUTATOR_LIBRARY works on closed-source parsers (Airbus SecLab).
    • Grammar engines. Nautilus, Jackalope and Fuzzilli.
    • Stateful protocols. Fandango 1.1 conversations, boofuzz sessions, InterceptFuzz prefix replay.
    • Corpus diversity. Project Zero’s fix for near-identical corpora is periodic empty-corpus restarts (P0).
  • Kernel fuzzing → Kernel Fuzzing.
    • Coverage. Instrument only the subsystem with KCOV (KCOV_INSTRUMENT := y per Makefile, not KCOV_INSTRUMENT_ALL) (Cloudflare).
    • Specs and steering. Hand-write syzlang from protocol specs, and steer with focus_areas weights (Doyensec ksmbd).
    • Other surfaces. Remote packet injection via syz_emit_ethernet (xairy), concurrency/race scheduling, and Windows, XNU and UEFI targets.
  • Differential fuzzing → Differential Fuzzing.
    • Multi-implementation. Compare x86 decoders (mishegos), Wasm runtimes (wasm-tools mutate, with the second runtime run via subprocess) and WASI rights handling.
    • JSONPath. Diff against independent implementations.
    • Equivalence. Use SAT miters for FPGA toolchains, and validate the oracle with negative controls. The web analogue is URL Parser Differentials.
  • LLM-assisted fuzzing → LLM-Assisted Fuzzing.
    • Harness synthesis at scale. OSS-Fuzz-Gen reached 272 projects and +370k lines, and found 26 vulns including CVE-2024-9143.
    • End-to-end agentic campaigns. Examples are the GHSL Taskflow, GPT-5.5-Cyber on zlib, and CERT.PL fuzzlab.
    • LLM-written generators. ChatAFL, G2Fuzz and Typos.
    • Build repair and patching. FuzzMedic repairs builds; CodeMender patches crashes.
    • The 7-gate evidence gate before reporting (Evidence gate).
    • Beyond fuzzers. LLMs also fuzz AI systems themselves; see AI and LLM Security and Prompt Injection.
  • Web fuzzing → Web Fuzzing.
    • ffuf. FUZZ keyword positions, matchers/filters and -ac auto-calibration. Multi-wordlist keywords and --input-cmd with radamsa turn it into a mutational body fuzzer (ACCEIS).
    • Specialised tools. BypassFuzzer for 401/403, h3fuzz for HTTP/3 speed, THEMIS for grey-box WordPress plugin fuzzing.
    • Neighbouring pages. Path brute forcing is on Content Discovery. Spec-driven REST/GraphQL fuzzing with RESTler, Schemathesis, WuppieFuzz and EvoMaster is on API Fuzzing. High-volume scripted requests and race conditions run through Turbo Intruder in Burp Suite.
  • Smart contracts.
    • Medusa. Geth-based, coverage-guided and parallel, with Slither-informed values (Medusa).
    • Echidna 2.4.0. Adds MCP and a faster hevm backend (Echidna 2.4.0).
    • Wake 5. In-process revm runs at 29,931 tx/s. Integer generator priors, not throughput, limit how far shallow assertions are exhausted (Wake 5).
    • Fuzzy. Grades Solana programs for missing signer checks, account substitution and overflow (Fuzzy).
  • Other domains.
    • Browsers. grizzly splits fuzzer Adapters from browser Targets and adds reduce/replay (grizzly).
    • Browser policy enforcement. BUIzz (USENIX Security ‘26) reuses WPT, DiffCSP and XSR-Framework test pages, drives 17 browser-UI interactions (context menu “open link in new tab/split view/private window”, Ctrl+Shift+T, …) through OS-level simulation, and flags a policy violation when enforcement differs before vs after the interaction, so it needs one browser, not cross-browser diffs. Pairs of interactions sufficed; 2,000 sampled triples found nothing new (BUIzz).
    • ICS. PLC code is translated to C and fuzzed with RL mutation; EM side-channel monitoring detects silent crashes (ICS dissertation).
    • Kubernetes. KubeFuzz fuzzes admission controllers (tl;dr sec #194).
    • Windows applications. WinDGF does directed greybox fuzzing, with up to +79.48% unique crashes over WinAFL/Winnie (WinDGF). TabuFuzz uses a tabu list to escape local optima (TabuFuzz).

Tools

NeedToolNotes
In-process C/C++libFuzzerclang -g -O1 -fsanitize=fuzzer,address t.c; ./t corpus/ -max_len=4096 -jobs=4 -workers=4; -merge=1 to minimize ([[raw/llvm.org/libfuzzer-a-library-for-coverage-guided-fuzz-testing-llvm-2925
Multi-core greyboxAFL++afl-fuzz -M primary -i seeds -o state -- ./fuzz, -S secondary01, -c0 -S cmplog; -x png.dict; afl-whatsup state/ ([[raw/appsec.guide/afl-testing-handbook-3925
Custom fuzzersLibAFLRust library with a libFuzzer drop-in and restarting event managers ([[raw/appsec.guide/libafl-testing-handbook-3912
Rustcargo-fuzzcargo +nightly fuzz run t -- -dict=d.dict; --sanitizer none when there is no unsafe ([[raw/appsec.guide/cargo-fuzz-testing-handbook-3906
Gogosentry, go-panikintgo test -fuzz on LibAFL with grammars and race/leak/overflow detectors ([[raw/blog.trailofbits.com/go-fuzzing-was-missing-half-the-toolkit-we-forked-the-toolchain-to-fix-8584
JVM / PythonJazzer, AtherisInjection sanitizers that also steer mutation ([[raw/github.com/jazzer-coverage-guided-in-process-fuzzing-for-the-jvm-4876
Snapshotswtf, Nyx/HyperHook, LibAFL-QEMUWindows user and kernel mode ([[raw/offsecblog.com/wtf-snapshot-based-fuzzing-of-windows-user-and-kernel-mode-targets-14698
Kernelsyzkaller, KernelGPTsyzlang specs; LLM-generated specs gave 24 bugs and 11 CVEs ([[raw/github.com/kernelgpt-enhanced-kernel-fuzzing-via-llms-4289
ProtocolsFandango, boofuzz, ScapyStateful conversations ([[raw/pepezamudio.com/when-the-input-is-a-conversation-fandango-1-1-stateful-protocol-fuzzin-14700
Differentialmishegos, wasm-tools mutatex86 decoders ([[raw/offsecblog.com/mishegos-for-differential-fuzzing-of-x86-instruction-decoders-13804
AgenticGHSL Fuzzing Taskflow, OSS-Fuzz agent skillsAFL++ + LCOV gap loop ([[raw/github.blog/ai-powered-fuzzing-with-the-github-security-lab-taskflow-agent-12103
Webffuf, Firefly, BypassFuzzerffuf -w params.txt -u 'https://t/x.php?FUZZ=test' -fs 4242; set -rate on production ([[raw/invadel.com/ffuf-explained-web-fuzzing-wordlists-detection-13945
Smart contractsMedusa, Echidna, Wake 5See Key techniques above

Pitfalls

  • Enrollment is not coverage. Fuzzers can be enrolled yet reach little code. Un-instrumented dependencies give no feedback, and libraries left out of the build are never fuzzed at all. That is where Poppler/DjVuLibre’s 1-click RCE lived (GHSL).
  • Byte mutation against nested formats. For MP4-style atom trees, the chance that a length-changing mutation survives drops exponentially with depth (Atredis).
  • More coverage ≠ more bugs. Bugs that need dataflow between two features add no new coverage, so the sample that combines them is never saved. Greedy saving also makes corpora near-identical (P0).
  • QEMU persistent mode without an input hook. The fuzzer re-runs the same input at full speed with zero new coverage (AFL++ QEMU mode).
  • State leaks and harness noise. State left over between iterations makes crashes irreproducible. syzkaller’s reset_net_namespace caused false-positive soft lockups until the net/sched descriptions were fixed (willsroot).
  • Harness bugs reported as target bugs. “A wrong harness fuzzes the harness” (xhack). Require deterministic replay, minimization and ownership attribution (HarnessMinimizer).
  • Treating compilation as success for LLM harnesses. Compilation is gate 3 of 7. Agents run untrusted code, so pin the runner and deny network (Evidence gate).
  • Weak oracles. Logic bugs need explicit checks. Differential setups with shared ancestry have correlated blind spots. Validate the checker with negative controls, as the iCE40 author’s checker failed twice before they did (iCE40).
  • Dead seeds. Tool-generated seeds can fail a vendor parser’s own rules (Quram rejects progressive JPEGs without AC Huffman tables even for DC-only scans, which kills jpegtran -scans output); read the library’s logcat [function:line] rejections and generate seeds that pass (Mobile Hacking Lab).
  • Weak setups. Under-resourced setups and already well-fuzzed targets give null results (json-c null result).
  • Loud web fuzzing. Default ffuf runs 40 threads with no rate cap and an identifiable UA (ffuf explained).

Real-world cases

  • GStreamer qtdemux: CVE-2025-47183/-47219/-47806/-47807/-47808 and CVE-2026-46469/-46470/-46471 came from targeted MP4 mutators after years of format-agnostic fuzzing (Atredis).
  • Poppler/DjVuLibre: 1-click Evince RCE CVE-2025-53367 sat outside the fuzzed build (GHSL).
  • ksmbd: CVE-2024-26980, CVE-2024-50283/-50285/-50286 and ~20 more from syzkaller SMB2 grammars and focus_areas (Doyensec).
  • Samsung Quram (CVE-2026-21096): progressive-JPEG IDCT indexed a scan-ordered geometry array and a frame-ordered output-row array with one counter, so a subset scan plus a sampling-factor change wrote IDCT output through out-of-bounds row pointers; the horizontal variant overwrote the aligned allocator’s stored raw pointer, putting pixel bytes into free(). P0 found it; LibAFL Frida mode on the phone rediscovered it in <1 s from crafted seeds and in 8 s after removing subset-scan seeds (fuzzer flipped a FF DA to FF FF fill so [2,3] became the first scan) (Mobile Hacking Lab).
  • Linux ocfs2 (CVE-2026-99430): modified syzkaller; a crafted image whose local quota header claims zero chunks makes ocfs2_local_quota_add_chunk() read qc_num through the list head, numbering the first chunk with half a kernel pointer; release clears a bit far outside the bitmap. Reported under five different KASAN/KFENCE titles because the name follows whatever object sits at the corrupted address (GHSA-7vhf-83c4-h86c).
  • Linux SUNRPC (CVE-2026-99528): customized syzkaller hit refcount_t: addition on 0 in xprt_alloc(); write_gssp() used the netns pointer stored as proc private data without taking a reference, so a write after setns() dropped the last ref resurrected a dying namespace (GHSA-hv78-pcw8-89vv).
  • OSS-Fuzz parsers: jxrlib initLookupTables() global over-read from an unchecked JPEG XR bit-depth index (CVE-2024-58408) and an OpenCV YAMLParser::parse infinite loop on a non-separator - line after the first document via cv::FileStorage (CVE-2026-135290, DoS) (GHSA-9q2x-93wf-wqpj, GHSA-h35f-7wcf-2h7h).
  • Linux net/sched: CVE-2025-38001 and CVE-2025-38616, paid through kernelCTF (willsroot).
  • libslirp: CVE-2026-9539 was reachable only with LibAFL-QEMU incremental snapshots (Quarkslab).
  • Adobe Acrobat: CVE-2026-81983, an OOB write found by an LLM-written fuzzer that mutated one image XObject inside a minimal PDF (Remedio).
  • zlib: GPT-5.5-Cyber built a zlib fuzzing lab in a day, and its best harness built valid gz* states (Trail of Bits).
  • V8: over six months BigSleep found 45 vulns and Fuzzilli 37, with ~25% overlap (Project Zero).
  • WASI: opening a file with create + read-only returned a writable handle on one runtime (Runtime Verification).
  • Browsers (BUIzz): 38 policy-enforcement bugs (35 security) across 7 headers in Chrome, Firefox, Edge, Opera, Brave and Whale: CSP, SameSite, Permissions Policy, COOP and HSTS bypasses, e.g. Brave’s “open link in split view” attaching a SameSite=Strict cookie cross-site. 14 patched, 7 CVEs, $14,700 from Edge, Brave and Whale (USENIX). See SameSite Cookies, Content Security Policy.
  • Windows Rust GDI: a kernel bugcheck during EMF+ fuzzing, fixed in KB5058499 (Check Point).
  • XNU: a harness produced 141 findings and 17 reports, including CVE-2026-112524 (Casco).
  • Siemens PROFINET DCP: Unicorn-AFL found 4 vulns (Nozomi).
  • binutils: the xcoff armap OOB was found by OSS-Fuzz (binutils fix).
  • Bug bounty web target: an ffuf parameter-discovery → sqlmap chain found multiple SQLi in minutes (ffuf + sqlmap).

Checklist

  • Target and oracle chosen. Existing OSS-Fuzz coverage, fuzzer count and dependency instrumentation checked.
  • Sanitizer builds (ASan/UBSan, MSan separately) plus a CMPLOG build. Checksums bypassed under FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION.
  • Harness has a min-length check and FDP decoding. No byte reuse, no I/O, no state carried between iterations. Invariant asserts and per-input timeout in place.
  • Harness builds valid state (container template, protocol prefix, snapshot) before mutating.
  • Seeds from tests, a dictionary, and a minimized corpus.
  • Parallel instances running. Stability ≈100%, LCOV gaps reviewed, structure added on a plateau.
  • Kernel: KCOV scoped to the subsystem; syzlang descriptions don’t leak state.
  • Non-crashing bug classes covered with differential or invariant oracles, and the oracle checked with negative controls.
  • Each crash is minimized, replays outside the fuzzer and is deduplicated. Harness-vs-project ownership decided and reachability proven.
  • LLM-generated work passed every evidence gate. The runner is isolated with network denied, and a manifest is recorded.
  • Web: rate limited, auto-calibrated, target-specific wordlists, hits proxied through Burp.
  • Corpus and crashers kept as regression tests. Short fuzz job in CI.

Sub-pages

  • Coverage-Guided Fuzzing — instrumentation-feedback fuzzing with AFL++, libFuzzer, LibAFL and language engines.
  • Web Fuzzing — wordlist/mutation fuzzing of HTTP requests for discovery, bypass and injection.
  • Grammar-Based Fuzzing — structure-aware generation and mutation for formats, languages and protocols.
  • LLM-Assisted Fuzzing — agents for harness synthesis, campaigns, triage and patching.
  • Fuzzing Harness Design — harness rules, input decoding, snapshot harnesses, ownership triage.
  • Kernel Fuzzing — syzkaller/KCOV, network and filesystem surfaces, concurrency, Windows/XNU/UEFI.
  • Differential Fuzzing — multi-implementation and equivalence oracles for non-crashing bugs.
  • Smart Contract Fuzzing — stateful invariant fuzzing of contracts with Echidna, Medusa, Foundry, Wake and agents.

Related topics: API Fuzzing · Content Discovery · Turbo Intruder · Burp Suite · AI and LLM Security · Prompt Injection · URL Parser Differentials · Reconnaissance · Bug Bounty Hunting

Sources