Agent Testing
FAQ
Autofix

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • Recommended

    owasp-rate-limit


    Formats: Severity:

    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-Limit
    • X-Rate-Limit-Limit
    • Both RateLimit-Limit and RateLimit-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.