Customizing the Default Expected HTTP Response Code for Fuzzers
When you explore the Fuzzers page, you'll notice that each fuzzer is associated with an expected HTTP response code. The fuzzer compares the received HTTP response code with the expected one and generates a report based on the match.
In certain scenarios, you may want to customize the default values expected by fuzzers.
In CATS 16.0.0, configure per-fuzzer overrides under the fuzzersConfig: section of your cats.yml file.
Besides expectedResponseCode, some fuzzers have their own settings, listed below.
--fuzzersConfig CLI flag removed in 16.0.0The standalone --fuzzersConfig <file>.properties CLI flag was removed in CATS 16.0.0. Move those entries into the fuzzersConfig: YAML mapping inside cats.yml (see the 16.0.0 migration guide).
The format of the keys under fuzzersConfig: is:
fuzzersConfig:
"fuzzerName.[path].[method].expectedResponseCode": value
where:
fuzzerNameis the canonical name of the fuzzer (note: in 16.0.0, use canonical names such asAbugidasInStringFieldswithout legacyTrimValidate/SanitizeValidatesuffixes)pathis the path of the endpoint exactly as it appears in the contract (optional)methodis the HTTP method of the endpoint (optional)valueis the expected HTTP response code
The most specific key takes precedence.
Example cats.yml:
contract: petstore.yml
server: http://localhost:8080
fuzzersConfig:
DummyAcceptHeaders.expectedResponseCode: 403
When running cats (which auto-discovers cats.yml, or with --configFile cats.yml), CATS interprets 403 as the expected response code for DummyAcceptHeaders, overriding its default value of 406.
Fuzzer-specific settings
Fuzzer-specific settings are supplied in the same fuzzersConfig: section using the key fuzzerName.setting:
| Key | Description | Default |
|---|---|---|
MultipartOversizedFile.sizeBytes | Size, in bytes, of the file part sent by the MultipartOversizedFile fuzzer | 10485761 (10 MiB + 1 byte) |
For example:
fuzzersConfig:
MultipartOversizedFile.sizeBytes: 52428801
The value must be a positive integer. If it is missing or invalid, CATS logs a warning and uses the default.