fix(api): handle non-ASCII API keys in constant-time comparison - #532
fix(api): handle non-ASCII API keys in constant-time comparison#532seonghobae wants to merge 2 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 21 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Superseded by canonical successor #520
This PR's valid product delta has been verified as fully inherited by #520 (
fix(auth): compare API keys at the raw ASGI boundary) on exact successor head08d1c3ca20e3e41a703ac9e5c5aea6f702962d2d.The succession is semantic, not a PR-count cleanup:
X-API-Keyinput must reject normally instead of reaching thehmac.compare_digest(str, str)ASCII-only error path — is retained;test_non_ascii_key_does_not_crashrequest-path regression and additionally covers configured Unicode credentials, wrong raw UTF-8/high-bit credentials, and duplicate header ambiguity;hmac.compare_digest(bytes, bytes)and preserves non-reflective 401 behavior;.jules/sentinel.mddoctrine from its effective delta.Before closing this lane, normal descendant
5f49cbd259c1e069b97e5b93c879acf81908936brestored this PR's generated.jules/sentinel.mdentry byte-for-byte to protectedmain, so the closed branch does not retain a repository-wide doctrine absent from the canonical successor.Python's authoritative contract remains that the
strform ofhmac.compare_digestis ASCII-only: https://docs.python.org/3/library/hmac.html#hmac.compare_digest#520 remains Draft and must satisfy its own exact-head CodeQL/control-plane, credential-registry governance, review, and protected-merge gates. Closing this weaker duplicate does not transfer predecessor workflow evidence or mark #520 complete.