fix(auth): constant-time Basic compare, code sweep, scrubber URL-password gaps#15
Conversation
…word gaps - check_basic compared the decoded credential with a short-circuiting String ==, a timing oracle on the one secret an attacker can iterate against (/authorize mints root-equivalent bearers). Now compares SHA-256 digests, making timing independent of where inputs differ. - Authorization codes abandoned without a redeem were never removed from the in-memory map (expiry was only checked lazily on redeem); new_code now sweeps expired entries, bounding the map. - The URL-credential scrubber's password group [^\s/@]+ leaked secrets containing '/' (no match at all — base64 secrets routinely have them) and the tail of passwords containing '@'. Now [^\s]+, greedy to the last '@' in the token — over-redacts host tails at worst, per the module's documented bias. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai approve |
✅ Action performedComments resolved and changes approved. |
Auth-boundary and credential-scrubbing fixes from the bug hunt, all with tests:
check_basicused a plainString ==(short-circuits on length and first differing byte)./authorizeis gated solely by this and mints root-equivalent bearer tokens, so the comparison time was an oracle an attacker can iterate against. Now compares SHA-256 digests — timing independent of where the inputs differ, and neither digest is attacker-controlled./authorizerequests) grew the in-memory map forever.new_codenow sweeps expired entries.[^\s/@]+meanthttps://user:abc/def@hostnever matched (whole secret leaked to GlitchTip — base64 secrets routinely contain/), andhttps://u:p@ss@hostleaked the tail after the first@. The group is now[^\s]+, greedy to the last@in the token; worst case it over-redacts a host tail, which is the module's documented bias.🤖 Generated with Claude Code