Skip to content

[Bug]: per-client rate limits key full IPv6 addresses, so one /64 gets unlimited budgets #547

Closed

Description

@jimhoyd

Runtime revision and environment

main at 645239b (static source review plus local synthetic checks). Node 22/26, macOS. Deployment: not applicable.

Minimal reproduction

Per-client keys use the raw client address:

  • core throttle: packages/core/src/policies/throttle.ts:58-62 (partition: client / client-route) via client-address.ts:77-85;
  • auth: packages/auth/src/auth-core.ts:1019-1021 (per-client password budget) and :1176-1177 (abuse-policy client, signupClient, challengeAfter).

A client that holds a /64 (routine for residential and cloud IPv6) can rotate addresses and receive a fresh budget each time, which also makes the Turnstile challengeAfter trigger ineffective. In core it can additionally churn the shared LRU key table (100,000 keys) and evict other clients' counters. Account-wide auth budgets still cap password guessing.

Relevant output

Traced in code; not executed against a deployment.

Suggested fix

Normalise IPv6 client keys to a /64 (configurable prefix) and IPv4-mapped ::ffff:a.b.c.d to IPv4 in one shared helper used by both core throttle and auth. Document the grouping in docs/POLICIES.md and packages/auth docs.

Activity

  1. added
    bug
    important
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions