Missing rate limit headers

owasp:api4:2019-rate-limit

Rule Severity:

High

Endpoints should use proper rate limiting to ensure service availability to all users.
This rule applies at the API Specification level (OAS/Swagger).
Include 'X-RateLimit-Limit', 'X-Rate-Limit-Limit', 'RateLimit-Limit' or 'RateLimit-Reset' in the HTTP headers to avoid unintended service disruption.

1. How to Identify with Example Scenario

Find the text in bold to identify issues such as these in API specifications

get:  
responses:
   "201":
     description: ok
     # missing X-RateLimit-Limit, X-Rate-Limit-Limit, RateLimit-Limit, or RateLimit-Reset in the headers

2. How to Identify with Example Scenario

Find the text in bold to identify issues such as these in API specifications

1. How to Resolve with Example Scenario

Find the text in bold to identify issues such as these in API specifications

get:
 responses:
   '201':
     description: ok
     headers:
       "X-RateLimit-Limit":
         schema:
           type: string
       "X-RateLimit-Reset":
          schema:
           type: string`

2. How to Resolve with Example Scenario

Modify the text in bold to resolve issues such as these in API specifications
References: