Conversation
…fy parallel lists Extends SHARED_PLATFORM_DOMAINS with 31 high-volume free-email provider domains (Gmail, Outlook, iCloud, Proton, Yahoo, AOL, Yandex, QQ, Tutanota, etc.) as defense-in-depth for brand identity hijacking via admin overrides or future trust paths. Surfaced during security review of PR #4157. Extracts FREE_EMAIL_PROVIDER_DOMAINS as a shared exported constant and replaces five previously-diverged inline arrays across admin-tools.ts (check_domain_health + suggest_prospects), slack-db.ts, and admin/domains.ts (x2) with imports of the shared constant. Adds assertClaimableBrandDomain unit tests (the function was previously untested). Closes #4165. https://claude.ai/code/session_01Wgjm3A6JbHWgfPCyDxUmoL
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4165
Summary
Extends
SHARED_PLATFORM_DOMAINSinidentifier-normalization.tswith 31 high-volume free-email provider domains (Gmail, Outlook, iCloud, Proton, Yahoo, AOL, Yandex, QQ, Tutanota, and others) as defense-in-depth against brand identity hijacking. WorkOS DNS verification makes admin-override exploitation implausible today, but the newprimary_brand_domainauto-populate path added in #4157 and themarkBrandDomainVerifiedwebhook are both gated byassertClaimableBrandDomain— this closes the gap for admin overrides and future trust paths.Extracts the list into an exported
FREE_EMAIL_PROVIDER_DOMAINSconstant and replaces five previously-diverged inline arrays acrossadmin-tools.ts(check_domain_health+suggest_prospects),slack-db.ts, andadmin/domains.ts(×2) with imports of the shared constant. Thesuggest_prospectshandler was also usingNOT LIKE '%@domain'patterns rather than parameterizedNOT IN— migrated for consistency and completeness.Adds
assertClaimableBrandDomainunit tests; the function was previously untested despite being a security gate.Non-breaking justification: Purely additive to a blocklist. Any domain entering
SHARED_PLATFORM_DOMAINSthat a legitimate brand already holds would have been blocked from claiming via WorkOS DNS verification anyway. Existing approved brand-claims are unaffected —assertClaimableBrandDomaingates new challenge issuance, not existing verified records. Server-only; no schema or protocol impact. Changeset is--empty.Follow-up (out of scope for this PR): The security review noted that
organizations.email_domainwrites in the WorkOS webhook andadmin/domains.tsare not guarded byassertClaimableBrandDomain. This is a separate blast radius (org membership auto-inference, not brand identity claim). Tracked for a follow-on issue.Pre-PR review
slack-db.ts,admin/domains.ts, andsuggest_prospectsLIKE clause as blockers; all three resolved in this diff. Notedorganizations.email_domainwrite path as a separate follow-up.assertClaimableBrandDomaintests (resolved). Confirmedme.cominclusion is correct (Apple-owned, no legitimate brand claimant).Setconstructor is correct (no bypass via type widening), SQL parameterization shifts correctly at 31 items, no remaining blockers.Session: https://claude.ai/code/session_01Wgjm3A6JbHWgfPCyDxUmoL
Generated by Claude Code