owasp-rate-limit
This rule checks each numeric response code from 200 to 299 and 400 to 499. Each response must declare at least one of these header sets, with the spelling shown:
X-RateLimit-LimitX-Rate-Limit-Limit- Both
RateLimit-LimitandRateLimit-Reset RateLimit
Wildcard responses such as 2XX, 4XX, and default are not checked. The rule checks header declarations, not header values or runtime rate limiting.
Bad example
openapi: "3.1.0"
info:
title: Chicken Nuggets API
version: "1.0"
paths:
/chickenNuggets:
get:
responses:
'200':
description: OK
Good example
openapi: "3.1.0"
info:
title: Chicken Nuggets API
version: "1.0"
paths:
/chickenNuggets:
get:
responses:
'200':
description: OK
headers:
RateLimit:
description: Rate-limit policy and remaining quota
schema:
type: string
How do I fix this violation?
Declare a supported header set on each checked response. Implement and test rate limiting in the API too.