Skip to main content
MediumConfigOWASP A04:2021CWE-799

How to fix: No Rate-Limit Policy Detected

No rate-limiting headers (X-RateLimit-Limit, RateLimit-Limit, Retry-After) or a 429 response were observed. Without rate-limiting, brute-force, credential stuffing, and scraping attacks can run unchecked.

Why it matters

Attackers can brute-force credentials, scrape all content, or exhaust backend resources with no request budget enforced. APIs without rate-limiting are a primary target for enumeration and DoS.

Rate-limiting controls how many requests a client can make within a time window. Without it, malicious actors can submit thousands of authentication attempts, harvest user data, or trigger expensive server operations at will.

How to fix it

  1. 1Add rate-limiting middleware (e.g., upstash/ratelimit, express-rate-limit, nginx limit_req).
  2. 2Return 429 Too Many Requests with a Retry-After header when the limit is exceeded.
  3. 3Return X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers on every response.

Code examples

Next.js API route (upstash/ratelimit)

TypeScript
import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';

const ratelimit = new Ratelimit({
  redis: Redis.fromEnv(),
  limiter: Ratelimit.slidingWindow(60, '1 m'),
});

export async function POST(req: Request) {
  const ip = req.headers.get('x-forwarded-for') ?? '127.0.0.1';
  const { success, limit, remaining, reset } = await ratelimit.limit(ip);

  if (!success) {
    return new Response('Too Many Requests', {
      status: 429,
      headers: {
        'Retry-After': String(Math.ceil((reset - Date.now()) / 1000)),
        'X-RateLimit-Limit': String(limit),
        'X-RateLimit-Remaining': '0',
      },
    });
  }

  return Response.json({ ok: true });
}

Nginx (limit_req)

nginx
http {
  limit_req_zone $binary_remote_addr zone=api:10m rate=60r/m;

  server {
    location /api/ {
      limit_req zone=api burst=10 nodelay;
      limit_req_status 429;
    }
  }
}

References

Detected automatically by VulnRadar. The check id is ratelimit-policy-missing, stable across every scan so you can filter or diff on it.

See every config check

Questions

How severe is No Rate-Limit Policy Detected?
VulnRadar rates this medium severity in the config category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id ratelimit-policy-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does No Rate-Limit Policy Detected map to?
It maps to CWE-799. In the OWASP Top 10 it falls under A04:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for no rate-limit policy detected

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: No Rate-Limit Policy Detected | VulnRadar