QID 570073
QID 570073: Retry-After Header Not Defined for 429 Response
Rate limiting is required to be defined to avoid attackers overloading an API operation. HTTP headers are used to define rate limits. 429 response codes should have rate limits defined. An analysis of the swagger file has resulted in detecting rate limit missing for 429 response code.
Following header are applied by default:
X-RateLimit-Limit
X-Rate-Limit-Limit
RateLimit-Limit
RateLimit-Reset
Swagger file is not compliant and will result in an error. Absence of proper rate limiting to the 429 response code will give an opportunity to overload the API. Absence of the retry limit will not protect the resource consumption over use by API consumers and attackers.
Solution
Implement rate-limiting using HTTP headers for 429 response code. IETF Draft HTTP RateLimit Headers:. https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/
For example:
'429': headers: RateLimit-Limit: ... RateLimit-Reset: ... Retry-After: description: The number of seconds to wait before allowing a follow-up request. schema: type: integer
'429': headers: RateLimit-Limit: ... RateLimit-Reset: ... Retry-After: description: The number of seconds to wait before allowing a follow-up request. schema: type: integer
Vendor References
CVEs related to QID 570073
Software Advisories
| Advisory ID | Software | Component | Link |
|---|