FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • ✨ New! Try the OpenAPI Doctor ✨ The OpenAPI Doctor
    Recommended

    owasp-rate-limit-retry-after


    Formats: Severity:

    Ensure that any 429 response, contains a Retry-After header.

    Define proper rate limiting to avoid attackers overloading the API. Part of that involves setting a Retry-After header so well meaning consumers are not polling and potentially exacerbating problems

    Bad example

    openapi: 3.1.0
    info:
      version: 1.0.1
    paths:
      /:
        get:
          responses:
            "429":
              description: ok
              headers: 
            "200":
              description: ok
              headers:
                "Retry-After":
                  description: standard retry header
                  schema:
                    type: string
    

    Good Example

    openapi: "3.1.0"
    info:
      version: 1.0
    paths:
      /cakes:
        get:
          responses:
            "429":
              description: OK
              headers:
                "Retry-After":
                  description: standard retry header
                  schema:
                    type: string`
    

    How do I fix this violation?

    Set the Retry-After header in the 429 response.