Repository navigation
Refuse a PKCE code as a session - #122
Conversation
A code whose signed message carries a code_challenge is good only through HiveSigner's token exchange, which checks the matching verifier. This service never sees the verifier, so accepting such a code would let whoever intercepted it use it directly.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoRefuse PKCE codes as API sessions
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper |
[Medium impact] The PR appears safe to merge. SummaryRejects signed messages containing
Reviews (1) · Last reviewed commit: "Refuse a PKCE code as a session" · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
A code whose
signed_messagecarries acode_challengeis a PKCE code (hivesigner-api#15). It is meant to be good only through HiveSigner's token exchange, which checks the matchingcode_verifier.ValidateCodeaccepted any signedecency.appcode, so an intercepted PKCE code could be used here directly and the verifier check skipped.IsEcencySessionnow refuses a signed message with acode_challengefield, whatever its value, before any account is read. Codes and tokens without the field are unchanged.Required by vision-mobile#3641 (point 4) before the first-party PKCE sign-in is enabled. It does not need to wait for hivesigner-api#15: no client sends such codes yet.
Tests (written first, failed before the change):
SessionTokenTests.ACodeCarryingAPkceChallengeIsNotASession: signed codes with a real S256 challenge, anullchallenge, and an empty one on a posting token all return no user, and no chain read happens.TokenTypeTests.EverythingElseIsRefused: two more cases for the rule itself.CLAUDE.md's list of what
ValidateCoderefuses now includes this case.Summary by CodeRabbit