improvement(auth): suffix-match BLOCKED_SIGNUP_DOMAINS to catch subdomain rotation#4773
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Parsing of Reviewed by Cursor Bugbot for commit 900f86e. Configure here. |
Greptile SummaryThis PR hardens the signup domain blocklist by switching from exact
Confidence Score: 5/5Safe to merge — the suffix-match logic is correct, both signup guard sites are updated, and the new test suite covers the full branch space including look-alike domain attacks. The change is well-scoped: domain === entry || domain.endsWith('.${entry}') correctly prevents exact-match bypass via subdomains and prevents look-alike bypass (e.g. xdpdns.org does not end with .dpdns.org). The filter(Boolean) and new Set() wrapping preserve the dedup and empty-entry behaviour previously noted. Both call sites behave identically to the old code for the null-denylist path because isEmailInDenylist short-circuits on !denylist. The test suite covers all meaningful edge cases. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Signup request / user.create hook] --> B{ctx.path starts with /sign-up or user.create.before?}
B -- yes --> C[isSignupEmailBlocked email]
C --> D[isEmailInDenylist email, blockedSignupDomains]
D --> E{denylist null or empty or email falsy?}
E -- yes --> F[return false - allow]
E -- no --> G[Extract domain via split at-sign index 1 .toLowerCase]
G --> H{domain is falsy?}
H -- yes --> F
H -- no --> I{denylist.some: domain === entry OR domain.endsWith .entry}
I -- match found --> J[return true - throw domain not allowed]
I -- no match --> F
B -- no --> K[Continue request]
Reviews (2): Last reviewed commit: "improvement(auth): dedupe denylist entri..." | Re-trigger Greptile |
|
@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 900f86e. Configure here.
Summary
Set.has()to suffix-aware: an entry ofdpdns.orgnow blocksdpdns.organd any*.dpdns.org.databaseHooks.user.create.beforeand the/sign-uprequest hook) with a singleisSignupEmailBlocked()helper.Type of Change
Testing
Tested manually —
isSignupEmailBlocked('a@dpdns.org'),isSignupEmailBlocked('a@xx.lucky04.dpdns.org'), andisSignupEmailBlocked('a@example.com')behave as expected against a denylist of[dpdns.org].Checklist