406 response should be defined for all GET, POST, PUT, PATCH, and DELETE operations
One or more operations in your API are missing
406 responses. Operations should have
default response defined if they do both of the following:
- The operation defines a response that is not a
- The operation constrains the MIME type of the response.
For more details, see RFC 7231.
The following is an example of how this type of risk could look in your API definition:
1responses: 2 "200": 3 description: pet response 4 schema: 5 $ref: "#/definitions/Pet" 6
Possible exploit scenario
Attackers strive to make your APIs behave in an unexpected way to learn more about your system or to cause a data breach. We highly recommend that you minimize any risks and clearly specify the data that your API operations can return for each possible response code.
Make sure that all operations that define a response that is not
204 and that constrain the MIME type of the response have the
406 response defined too.
1responses: 2 "200": 3 description: pet response 4 schema: 5 $ref: "#/definitions/Pet" 6 # ... 7 "406": 8 description: Not Acceptable 9 schema: 10 $ref: "#/definitions/406" 11
Copyright 42Crunch 2021