fix(security): isolate rejected OTP attempts - #7008
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview Unauthorized emails skip Reviewed by Cursor Bugbot for commit abd36ff. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR prevents rejected public OTP attempts from consuming legitimate send budgets and removes allow-list response differences by moving authorized OTP delivery behind the response boundary.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/chat/[identifier]/otp/route.ts | Moves authorized chat OTP throttling, persistence, and delivery after the generic response while preserving uniform IP throttling. |
| apps/sim/app/api/files/public/[token]/otp/route.ts | Applies the same post-response OTP delivery model to public file shares without exposing allow-list or send-limit outcomes. |
| apps/sim/lib/core/utils/after-response.ts | Adds a small shared wrapper around Next.js post-response task registration. |
| apps/sim/app/api/chat/[identifier]/otp/route.test.ts | Adds regression coverage for generic responses, rejected requests, deferred execution, and retained throttling. |
| apps/sim/app/api/files/public/[token]/otp/route.test.ts | Covers rejected addresses, absent client IPs, delivery failures, deferred work, and resource and recipient limits. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Request[Public OTP request] --> IP[Apply uniform IP throttle]
IP --> Resolve[Resolve chat or file-share resource]
Resolve --> Allow{Email allowed?}
Allow --> Response[Return generic accepted response]
Response --> Deferred[Run post-response callback]
Allow -->|No| Skip[Skip send-budget and delivery work]
Allow -->|Yes| Deferred
Deferred --> Resource[Apply resource limit]
Resource --> Recipient[Apply recipient limit]
Recipient --> Store[Generate and store OTP]
Store --> Send[Send verification email]
Reviews (3): Last reviewed commit: "fix(security): defer OTP delivery work" | Re-trigger 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 ed1b07d. Configure here.
|
@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 abd36ff. Configure here.
Summary
Type of Change
Testing
bun run lintbun run check:audits(33 audits passed)Checklist