Title: fix(sso): surface DNS verification failures and the provider auto-append gotcha by waleedlatif1 · Pull Request #5931 · simstudioai/sim · GitHub
Open Graph Title: fix(sso): surface DNS verification failures and the provider auto-append gotcha by waleedlatif1 · Pull Request #5931 · simstudioai/sim
X Title: fix(sso): surface DNS verification failures and the provider auto-append gotcha by waleedlatif1 · Pull Request #5931 · simstudioai/sim
Description: Summary Follow-ups from a post-merge audit of verified domains (#5909). The security core came back correct — exact-match (not suffix-match) domain comparison, closed TOCTOU, 192-bit row-bound tokens, and no way to verify a domain without controlling its DNS zone. These fix the operational gaps around it. DNS provider auto-append. We handed admins the FQDN _sim-challenge.acme.com. GoDaddy, Namecheap, Hover and most cPanel panels append the zone to whatever is typed → _sim-challenge.acme.com.acme.com. The record looks correct in their panel, verification never succeeds, and our 422 tells them to wait 48 hours. Added a hint under the host field and a docs callout. (Cloudflare/Route 53 take the full host, so both forms are covered.) DNS failures were invisible in prod. They were logged at debug, but production log level is ERROR — so blocked egress or SERVFAIL produced zero signal for us and was misreported to the admin as "record not found yet". Infrastructure-class failures now log at warn with the DNS error code; genuinely-absent codes (ENODATA/ENOTFOUND/NXDOMAIN) stay at debug. Trim the joined TXT value. Several DNS panels pad the stored string, which otherwise fails an exact match forever with no way for the admin to tell why. Concatenation happens first, so trimming can't corrupt a chunk boundary. Still an exact match — no case-folding. Bounded the resolver. c-ares multiplies timeout across servers and retries by ~7x (measured), so the previous 5s/2-try config could block a verify request ~35s when resolvers are unreachable. Now 2s/1 try. Tests for checkDomainTxtRecord — the function that decides whether the gate opens had none. Covers exact match, chunk-joined value, match among unrelated records, padded value, near-miss, another org's token, absent record, infrastructure failure, and empty response. Verification The mechanism was also validated empirically against live DNS (not just reviewed): NXDOMAIN → false without throwing, a host with 15 unrelated TXT records → false, a genuinely published record → true found among those 15, and a 410-char record split across 2 chunks → joined and matched. Not included (deliberate) No data migration for the backfill normalizer. Migration 0268's SQL normalizer is a subset of normalizeSSODomain (no protocol/port/path/trailing-dot stripping). Prod is unaffected — its only SSO domain is already canonical (hex-verified). Replicating the full 7-step regex chain in SQL would risk introducing exactly the divergence it's meant to fix, and the self-host registration script already self-heals: it normalizes through the shared function and upserts the verified row. Periodic re-verification (verification currently never expires) is a product decision, not a bug fix — worth its own change. Type of Change Bug fix Testing 16 tests in domain-verification.test.ts (was 6); 65 across the SSO/domains surface. tsc 0, check:api-validation, check:utils, check:migrations all clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Follow-ups from a post-merge audit of verified domains (#5909). The security core came back correct — exact-match (not suffix-match) domain comparison, closed TOCTOU, 192-bit row-bound toke...
X Description: Summary Follow-ups from a post-merge audit of verified domains (#5909). The security core came back correct — exact-match (not suffix-match) domain comparison, closed TOCTOU, 192-bit row-bound toke...
Opengraph URL: https://github.com/simstudioai/sim/pull/5931
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:80aafc56-bbad-2eeb-9d1b-14939c64aa20 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 90FC:1C88A1:63F92B:8E818C:6AFB43E3 |
| html-safe-nonce | ec2821d92b697f23c01917d695986f5706978884e84eef3fbd756df7d662051c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEZDOjFDODhBMTo2M0Y5MkI6OEU4MThDOjZBRkI0M0UzIiwidmlzaXRvcl9pZCI6IjMzNjk1ODk5Nzc5NTkzMTg0OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5d93fe657973b99ef9c477f8fb144462f8ae1b7d09d8e4cb679df0fc892d1f0b |
| hovercard-subject-tag | pull_request:4126915735 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5931/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Follow-ups from a post-merge audit of verified domains (#5909). The security core came back correct — exact-match (not suffix-match) domain comparison, closed TOCTOU, 192-bit row-bound toke... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a6c2f87cbcb6414452377b4967858ed6a66f1109 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width