Skip to content

Login or password reset with no rate limit in sight

Partialmedium severity · reads .ts .tsx .js .jsx .mjs .cjsBeta

Without a limit, anyone can try passwords, one-time codes or reset links as fast as they like (CWE-307). Partial: a firewall, an API gateway or your auth provider may already limit this outside the code. When Lintsure finds this, it marks it as Partial: it may be fine, depending on context only you can confirm.

How to fix it

Limit how often one IP or account can try: a middleware limiter (for example @upstash/ratelimit, express-rate-limit or rate-limiter-flexible), or a firewall rule for this path. Lock or slow down after repeated failures.

Through a coding agent, Lintsure suggests the change and waits. Nothing is edited until you approve it.

Controls it relates to

  • OWASP Top 10A07:2025Authentication Failures
  • API2:2023Broken Authentication
  • API4:2023Unrestricted Resource Consumption

What the framework asks

OWASP Top 10 A07:2025: Authentication Failures

Logins and sessions that hold up: no passwords in code, strong secrets, tokens that expire and are verified, and session cookies protected from scripts and plain HTTP.

Evidence a reviewer may ask for: Login, session and token settings.

API2:2023: Broken Authentication

Sign-in, tokens and password resets must resist guessing, forgery and theft: verified tokens that expire, strong password hashing and limits on attempts.

Evidence a reviewer may ask for: How tokens are issued, checked and revoked, and the limits on sign-in attempts.

API4:2023: Unrestricted Resource Consumption

Limit how often, how much and how long: request rates, page sizes, upload sizes, and anything you pay for per call.

Evidence a reviewer may ask for: The limits in code and at the gateway, and spending caps with providers.

Summaries are our own reading of the public texts, not the official wording.

Check your code for this

Runs on your machine. Your code is never uploaded.

npx lintsure scan

Quickstart · Use it in Claude Code or Cursor

This rule is in Beta: its mapping to framework controls is our own reading of the public texts, not independently reviewed. Lintsure is a readiness tool, not an audit or legal advice. A finding, or the lack of one, doesn't make you compliant. Disclaimer

We improve these rules all the time. If you see a false alarm, a missed problem or anything that could work better, tell us in a review and we will use it to improve your experience.

Related rules

Did this rule flag something that's fine, or miss a real problem? Tell us on GitHub. Every report becomes a test case, so the same mistake can't come back.