Harden OAuth redirect, secret, and token expiry checks - #58
Conversation
|
Thank you @grantf04 for taking this on — and apologies that it sat in review as long as it did. Your fix was correct: I reviewed it against #6/#7/#8 and all three holes were properly closed, with sensible coverage of the This ended up as a head-to-head with #59, which fixed the same three issues, and I could only merge one. I went with #59 on two narrow technical points: it rejects legacy tokens that have neither I'd genuinely welcome more contributions from you. The exercise-library issues (#62, #63) are open, and the roadmap in ROADMAP.md has plenty more — and if you comment on an issue first per BOUNTIES.md/CONTRIBUTING.md, we can avoid the duplicate-work situation that happened here. Thanks again. |
Summary
Fixes #6
Fixes #7
Fixes #8
Hardens the OAuth flow by validating registered redirect URIs, comparing client secrets with
crypto.timingSafeEqual, and adding expiration to OAuth access tokens. I saw these were proposed as S-size security bounty candidates, but I understand they are not currently formalized live bounties.Changes
redirect_uriagainst the OAuth client'sredirectUrisduring/authorize,/login, and/callbackcrypto.timingSafeEqualexpiresAtfor newly issued OAuth tokens and returnexpires_infrom/tokencreatedAtType
Testing
Manual verification:
cd functions && npm run buildAI Usage
AI tools used: OpenAI Codex
What AI generated: OAuth/security patch implementation and PR text
What was human-reviewed/modified: Security behavior, redirect validation coverage, token expiry behavior, and TypeScript build output
Screenshots
No UI changes.