liveBook · Manning

Fuzzing

As explained in Secure APIs

Fuzzing is software testing that supplies varied, malformed, or unexpected inputs to discover faults and vulnerabilities.

Fuzzing tests software by sending varied, malformed, or unexpected inputs and observing whether it crashes, returns errors, or behaves unexpectedly. For APIs, fuzzing checks whether the implementation conforms to its specification and reveals how attackers might abuse weak input handling. section 1.2.2 section 12.3

Use fuzzing as part of API implementation and testing:

  • Generate test cases from an API specification, including valid and invalid payloads. section 1.2.2 section 12.3
  • Run tests against a live server with authentication when protected endpoints require it. section 12.3
  • Inspect failures for server errors, status-code or schema mismatches, ignored authentication, and rejected negative data. section 12.3
  • Use the findings to correct API drift, validate inputs, and prevent crashes or unexpected behavior. section 1.5 section 12.3

Finding an unhandled payload

A Schemathesis test sends a registration request whose phone_number contains a NUL byte. The API reaches the database and produces a PostgreSQL DataError instead of handling the input safely, exposing a defect for remediation. section 12.3

Figure 1.6 Security by design fits into every step of the API development cycle. It encourages us to approach design, implementation, testing, and operations from a security point of view.
figure

Use the security-by-design cycle to place fuzzing after implementation while continuing security checks through design, testing, and operations. section 1.5

How Secure APIs covers it

How deep it goes
Demonstrates specification-driven execution, authentication setup, result interpretation, and a database failure, but stops short of remediation code.
Examples
Uses Schemathesis, OpenAPI specifications, live endpoints, malformed registration data, conformance reports, and a PostgreSQL NUL-byte error.
What it assumes
Assumes an API specification, a running server, and credentials for protected endpoints while introducing fuzzing through a concrete workflow.
What you can do after
Diagnose API drift, conformance failures, ignored authentication, and input-handling defects with specification-driven tests.
How it connects
Connects fuzzing with contract testing, API specifications, input validation, authentication, authorization, and API security.

Also explained in

Compare how 7 books explain fuzzing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.