fix(chat): close SSO auth bypass via checkSSOAccess body flag#4408
fix(chat): close SSO auth bypass via checkSSOAccess body flag#4408waleedlatif1 merged 3 commits intostagingfrom
Conversation
- Remove checkSSOAccess short-circuit; SSO branch always validates via getSession() - Skip chat_auth cookie issuance/validation for SSO deployments to prevent replay - Split eligibility pre-flight into dedicated POST /api/chat/[identifier]/sso route - Drop .passthrough() and checkSSOAccess from deployed chat contracts - Add SSO branch test coverage in chat utils
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview SSO preflight is split into a separate endpoint. Adds Request validation is tightened and tests added. Removes Reviewed by Cursor Bugbot for commit 92ee9fe. Configure here. |
Greptile SummaryThis PR closes an SSO authentication bypass by removing the Confidence Score: 5/5Safe to merge — the core security bypass is correctly closed and all three attack surfaces are addressed. Only P2 findings remain (rate-limiting no-op for unknown IPs). The critical bypass paths are all properly fixed with good test coverage. apps/sim/app/api/chat/[identifier]/sso/route.ts — the unknown-IP rate-limit skip warrants a follow-up hardening. Important Files Changed
Reviews (2): Last reviewed commit: "fix(chat): close SSO GET cookie replay a..." | Re-trigger Greptile |
- Skip chat_auth cookie validation for SSO in GET handler (replay vector for pre-fix cookies) - Route SSO GET through getSession() instead of always returning auth_required_sso so post-IdP config fetch works - Add per-IP rate limiting to /api/chat/[identifier]/sso to prevent allowlist enumeration
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 92ee9fe. Configure here.
Summary
checkSSOAccessshort-circuit invalidateChatAuth— SSO branch now always validates viagetSession(), body-supplied email is ignoredchat_authcookie issuance and validation for SSO deployments to close the replay windowPOST /api/chat/[identifier]/ssoendpoint that returns{ eligible }and never touches the executor.passthrough()andcheckSSOAccessfromdeployedChatAuthBodySchema/deployedChatPostBodySchemachat/utils.test.tsType of Change
Testing
Tested manually;
bun run check:api-validationpasses.Checklist