QID 570010
QID 570010: Missing 4XX Responses on the End Point
When the API end point is not utilized properly error should be reported. When request is crafted incorrectly 4XX error code is reported. All the end points responses are analyzed for specific response codes. Analysis of the swagger file resulted in the current end point not being defined to return 4XX response code. One of the following 4XX HTTP status codes should be returned on all the requests that are have unexpected information:
400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
407 - Proxy Authentication Required
408 - Request Timeout
413 - Payload Too Large
414 - URI Too Long
When the operation results in a 4XX response the end point will not be able to service the request.
Solution
Please return a 4XX response for all the operations.
"/burger":
get:
responses:
"200":
description: All the burgers please
"429":
description: We're super busy right now, please wait.
post:
responses:
"401":
description: This API is protected, only authorized users.
"200":
description: Burger was created! well done
Vendor References
CVEs related to QID 570010
Software Advisories
| Advisory ID | Software | Component | Link |
|---|