Fuzzing our API from its OpenAPI document found 29 server errors in one run

The first Schemathesis run against Kommo's API returned 29 server errors from two classes of bug. What they were and how we fixed each class.

The short answer

We pointed Schemathesis, a property-based API fuzzer, at Kommo's OpenAPI document. Its first run got 29 server errors. They came from two classes of bug: requests with no body skipped validation of optional bodies, and NUL characters in input reached PostgreSQL. We fixed each class across the whole API, not one endpoint at a time, and the fuzzer now runs daily.

On this page
  1. What is API fuzzing?
  2. Class 1: a POST with no body at all
  3. Class 2: NUL characters
  4. How did we confirm the fixes?
  5. Where does fuzzing run now?
  6. Should you fuzz your API?

Kommo, our salon hiring app, had a large test suite and a typed API with an OpenAPI document. In November 2026 we added one more kind of test: a fuzzer that reads the OpenAPI document and sends the API generated requests, valid and not quite valid, to see which ones make it fail.

The first run got 29 answers of 5xx (server errors). None of our existing tests had found them. This post covers what they were and how we fixed them.

What is API fuzzing?

We use Schemathesis. It reads the API’s OpenAPI document and, for every endpoint, generates requests from the declared schema: normal values, edge cases, empty strings, odd characters, missing fields. A well-behaved API answers a bad request with a 4xx that explains the problem. A 5xx means the server didn’t expect the input, which is a bug even when it isn’t a security problem.

Class 1: a POST with no body at all

Several endpoints declared an optional request body. When a request arrived with no body and no Content-Type at all, validation of that optional body was skipped, and the handler then read fields from a body that didn’t exist.

A unit test would hardly ever send that, because a real browser always sends a body. The fuzzer sends it on purpose.

The fix was a rule, not a patch per endpoint. Every request body is now required, except three that are optional by design. A contract test lists those three, so making a new body optional is a visible decision in code review rather than an accident.

Class 2: NUL characters

A NUL character (\0) in a path, a query parameter or a JSON string passed validation, because it’s a valid character in a string, and then reached PostgreSQL, which refuses NUL in text and raised an error.

The fix: every request with a NUL character anywhere in its path, query or JSON body is refused with a 400 before it reaches any handler. One check at the edge covers every endpoint, including ones not written yet.

How did we confirm the fixes?

  • A test that sends a body-less POST failed before the fix and passes after it.
  • A test for NUL characters in each part of a request.
  • The client types generated from the OpenAPI document were regenerated, since bodies are no longer optional, and the compiler checked every caller.
  • The fuzzer was run again, and the two classes were gone.

We also searched our other products for the same two classes of bug, since they share most of their stack.

Where does fuzzing run now?

Not on every pull request: a full fuzz run takes too long for that. It runs in a daily job together with two other slow checks: the test suite in a shuffled order with a logged seed (to catch tests that depend on each other) and mutation testing on the permission code (to check the tests would notice if a permission check were removed). The daily job reports to our uptime checker when it succeeds, so a run that silently stops is noticed too.

Should you fuzz your API?

If you already have an OpenAPI document, a first run costs an afternoon. Expect the first run to find things your tests didn’t. Then fix each class of failure at one place, such as the request parser or a shared validation rule, rather than endpoint by endpoint.

Keep reading

Tell us what you want to build.

A product, a website, a search problem or a system that should work better. We reply with a plain answer and the first step.

A few sentences are enough (at least 20 characters).

We use your details only to answer your inquiry. See our privacy policy.