# API Fuzzing > Spec-driven fuzzing generates large numbers of unexpected requests from an OpenAPI/GraphQL/gRPC definition and watches for crashes, spec violations and authorization-oracle failures. It reaches the negative cases hand-written integration tests skip, and newer tools add BOLA/BFLA and injection oracles on top of the classic 5xx-crash signal. ## How it works - Input is a **request sequence**, not a single request. A corpus generator reads the spec, infers producer→consumer dependencies (the `id` from `POST /items` feeds `GET /items/{item_id}`), and orders create→read→delete so requests reach code behind "must exist" checks (RESTler's stateful model; WuppieFuzz does the same). - **Mutation** happens at two levels: value mutators (boundary numbers, wrong types, injection payloads) and structural mutators (add/drop/reorder requests in a sequence). - **Feedback**: black-box uses endpoint coverage (a new method+path+status combo is interesting); grey/white-box attaches a coverage agent (JaCoCo for Java, LCOV for Python) to drive on code coverage. - **Objectives / oracles**: a 5xx is a finding; so is any spec violation (undocumented status, body failing the schema, body where none is declared); so is a reflected injection signature. The access-policy research adds oracles for BOLA/BFLA by comparing what different identities can reach. ## Tooling | Tool | Notes | |---|---| | **RESTler** (Microsoft Research) | First stateful REST fuzzer; infers producer-consumer deps from OpenAPI, learns from responses. Run `test` mode before fuzzing to fix setup. Has found bugs in Kubernetes etc. | | **CATS** (Endava) | 200+ fuzzers across 4 stateful waves (seed, coverage, crash, consistency); learns IDs/ETags from 2xx; `analyze` gives a 0–100 fuzzability score; `--profile security`; JSON output for CI. | | **WuppieFuzz** (TNO, Rust/LibAFL) | Coverage-guided, black/grey/white-box; v1.7 added injection payloads (SQL, NoSQL, LDAP, path traversal, XXE) from grammars; v1.8.1 emits a Web Fuzzing Commons `report.json` and split injection-signature crash criteria (`PossibleSqlInjectionSignature`, etc.). Generates heavy, obvious fuzzing traffic. | | **Schemathesis** | 4.33.0 adds a coverage phase for GraphQL, `response_schema_conformance` checking GraphQL `data` for missing/unrequested/mistyped fields, and fuzzing of unary gRPC via reflection or descriptor sets. | | **openapi-fuzzer** (Rust) | Black-box; saves regression seeds; common finds are parsing, invalid-format and nonexistent-entity bugs. | | **EvoMaster + access-policy oracles** (arxiv 3015) | Extends EvoMaster with automated oracles for access-policy violations (BOLA/BFLA) plus SQLi and XSS, beyond the usual 500-error crash detection. | ## Practical notes / limits (WuppieFuzz critique) - **Big specs explode the search space** (every endpoint × parameter × ordering); CI gives minutes, not days. - **Async work and microservices** break the response→next-request plumbing that stateful fuzzing relies on. - **Instrumentation overhead** slows white-box runs. - The tooling itself generates obvious, repetitive traffic and writes a request DB — WAFs and API owners will see it; use only on your own services or under explicit authorization. ## Notable cases - RESTler and openapi-fuzzer have both been used to find bugs in Kubernetes and other well-known software (parsing, invalid-format, nonexistent-entity classes). - The access-policy-oracle work is motivated by BOLA ranking API1 and BFLA API5 in the OWASP API Top 10, and by 42crunch's finding that Missing Authentication was the most frequent API vuln of 2025 — all authz failures that crash-only fuzzers miss. ## Defenses (for API owners) - Run spec-driven fuzzing in CI with a fuzzability check so the spec stays testable (CATS `analyze`). - Treat spec violations (undocumented status, schema-nonconforming body) as findings, not noise — they mark drift and error-handling gaps. - Add authz oracles (two identities per role) so the fuzzer can catch BOLA/BFLA, not just 5xx. ## Related - [[API Security]] - [[OWASP API Security Top 10]] - [[BOLA in APIs]] - [[Function Level Authorization]] - [[API Discovery]] - [[Coverage-Guided Fuzzing]] - [[Web Fuzzing]] - [[GraphQL Security]] ## Sources - [[raw/github.com/restler-stateful-rest-api-fuzzing-tool-3984|RESTler: Stateful REST API Fuzzing Tool]] - [[raw/endava.github.io/cats-rest-api-fuzzer-and-negative-testing-tool-3983|CATS: REST API Fuzzer and Negative Testing Tool]] - [[raw/offsecblog.com/wuppiefuzz-coverage-guided-rest-api-fuzzing-14108|WuppieFuzz: coverage-guided REST API fuzzing]] - [[raw/github.com/wuppiefuzz-1-8-1-rest-api-fuzzer-adds-web-fuzzing-commons-reports-and-14563|WuppieFuzz 1.8.1: REST API fuzzer adds Web Fuzzing Commons reports and injection signatures]] - [[raw/blog.shellnetsecurity.com/fuzzing-a-rest-api-with-wuppiefuzz-12683|Fuzzing a REST API with WuppieFuzz]] - [[raw/github.com/openapi-fuzzer-black-box-fuzzer-for-openapi-specifications-3982|openapi-fuzzer: Black-box Fuzzer for OpenAPI Specifications]] - [[raw/github.com/schemathesis-4-33-0-graphql-coverage-phase-and-unary-grpc-fuzzing-14494|Schemathesis 4.33.0: GraphQL coverage phase and unary gRPC fuzzing]] - [[raw/arxiv.org/enhancing-rest-api-fuzzing-with-access-policy-violation-detection-3015|Enhancing REST API Fuzzing with Access Policy Violation Detection]]