Repository navigation
Conversation
After a server restart every cookie session is gone (they live in memory). An open tab's background requests then carry only the dead cookie and no Authorization header. Each one was counted as a failed login: ten filled the single-user per-IP bucket within seconds, and the 429 that followed carries no WWW-Authenticate challenge, so the browser never showed its login dialog again and reloading could not recover for 15 minutes. Behind a tunnel all clients share 127.0.0.1, so every device was locked out. Multi-user mode had the same shape against its per-IP pre-gate, which refuses even a correct password once full. A request with no Authorization header is not a guess and runs no password check, so it is now challenged with a plain 401 and not counted, in both modes and even while the IP is limited. Wrong and malformed credentials are counted and limited exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After a server restart, a browser that had Codeman open gets stuck on
Too Many Requests — try again laterand reloading doesn't help.Authorizationheader. Each was counted as a failed login against the client IP.AUTH_FAILURE_MAX) within seconds.WWW-Authenticatechallenge, so the browser never shows its login dialog again. The user can't type the (still accepted) correct password until the 15-minute window expires.Behind a tunnel all traffic arrives as
127.0.0.1, so one stale tab locks out every device. Multi-user mode has the same shape: credential-less requests filled the per-IP pre-gate (AUTH_IP_FAILURE_MAX), which refuses even a correct password once full.Fix
A request with no
Authorizationheader is not a guess and runs no password check. It now gets a plain401+WWW-Authenticatechallenge and is not counted, in both modes and even while the IP is rate-limited. That keeps the browser's login dialog reachable.Unchanged: wrong credentials and malformed
Authorizationheaders are counted and limited exactly as before (same buckets, same caps, same 429 +Retry-After). The hook-secret bucket is untouched.Security: nothing is gained by sending header-less requests. They cost no scrypt and reveal nothing beyond the existing 401.
Tests
auth-security.test.ts: cookie-only requests (3× the cap) stay 401 with a challenge and leave the wrong-password bucket empty. During a lockout a header-less request still gets the 401 challenge, while wrong credentials still get 429.multiuser-auth.test.ts: cookie-only requests pastAUTH_IP_FAILURE_MAXstay 401, the per-IP bucket stays empty, and the correct password logs in.masterwithout the fix. The six auth suites pass with it (160 tests). Typecheck, lint and prettier are clean.🤖 Generated with Claude Code