Repository navigation
[Chore] Patch Better Auth and preserve sign-in - #3734
Conversation
|
No new code issues found. The prior finding is addressed: the fixture verifies the local account and includes successful boolean/string true controls. CI tests and JavaScript/TypeScript CodeQL analysis were still running when checked. See session
Reviewed bd8df46 |
|
Addressed the sole valid finding in bd8df4663 on this same branch. No findings disputed. The local account is now explicitly verified before testing provider claims, with successful boolean/string 71 auth/server tests passed, web fast types and normal pre-commit/pre-push gates passed, and genuine browser password sign-in was rerun. The Roomote code review check now passes, its summary reports no unresolved issues, and the review thread is resolved. Other CI tests were still running at the last check; no all-CI-green claim. PR assessment now explicitly includes the default verified-local-email precondition and preserves both advisory condition tables and production-config uncertainty. Live external OAuth, actual email delivery and production exposure remain unverified. Initial production build/client test results are labeled as initial-run evidence; the follow-up changed only a test. Assessment and evidence limits · Test/mutation/push logs. Refreshed sign-in screenshots are in the PR body. Draft status is explicitly held; no merge or auto-merge. |
Related issue
Addresses GHSA-9hm7-xhfp-cx58 and GHSA-hwq2-v29r-p69r. Both advisories identify 1.7.16 as the first patched stable release.
Why this PR exists
Requested security upgrade with sign-in evidence and a condition-by-condition exposure assessment. The reported 1.6.22 premise is stale: inspected develop and the installed graph were 1.7.12, following the main Roomote migration in #3636. No equivalent open 1.7.16 upgrade was found. Roomote-Cloud is a separate application and was not used to infer this application's behavior.
What changed
better-authand direct@better-auth/drizzle-adapterfloors to ^1.7.25; align core, telemetry, and all bundled adapters (Drizzle, Kysely, memory, MongoDB, Prisma) at 1.7.25 in the generated lockfile.minimumReleaseAge: 10080, its existing exclusions, andblockExoticSubdeps. All 11 new package resolutions independently pass the seven-day age requirement. 1.7.25 was the newest stable version eligible under that policy at resolution time.Advisory conditions and deployment assessment
Evidence boundary: The following repository evidence describes this PR's base (
c515059f5), not verified production configuration. A read-only deployment-access probe failed; production's installed version/SHA, effective environment/database-backed provider settings, email channel/sender, upstream claims, invites and historical address reuse were not verified. The sandbox is not production. Therefore production exposure to either advisory is unknown, not established by these defaults. A deployment running this PR's 1.7.25 graph is outside both advisories' affected ranges.GHSA-9hm7-xhfp-cx58 — OAuth verification/profile identity
Upstream lists three alternative provider conditions, with an exception for intentionally trusted email-linking providers.
auth.tsconditionally configures generic Slack/GitLab/Gitea/Bitbucket/ADO from effective credentials; Microsoft is added separately byauth-oauth-compatibility.ts.email_verified; Microsoft compatibility mapping forwards the optional claim. Thus raw string values could reach core. GitLab explicitly returns a boolean derived fromconfirmed_at; Gitea/Bitbucket/ADO return false. No Cognito provider is configured. Source does not establish actual Slack/Microsoft claim types or their address-ownership rules.genericOAuth()provider has a JWKS endpoint; mismatched userinfo/ID-token subjects or submitted access-token profilediscoveryUrlor a configured/discoveredjwks_uri. This particular generic-JWKS condition is not met by the checked-in configuration. Microsoft's separate built-in wrapper explicitly verifies token signature/issuer/audience/expiry/tenant/nonce and binds userinfosub.disableSignUp,requireEmailVerification, oroverrideUserInfoOnSignInaccount.accountLinking.trustedProvidersallowDifferentEmails: truedoes not establish that exception.requireLocalEmailVerifiedto true. This application does not override it, so the existing local account must also be verified for this implicit-linking path.For the email-linking impact, an existing verified local account must own the address and an untrusted provider profile must be accepted as verified; new users can also be incorrectly stored verified. The revised Slack regression explicitly verifies and asserts the local email/password account before sign-in, rejects
"false","0","unverified"and boolean false, and asserts no linked account or session. Boolean true and string"true"controls must successfully link and receive the same user's session. The original fixture's unverified-local-email guard masked provider-claim parsing; review finding #4659006341 was valid and corrected inbd8df4663. Normal explicit linking and returning linked identities still pass.GHSA-hwq2-v29r-p69r — email-change link address reuse
All three configuration conditions are required, plus the address-reuse race while an old link is valid.
user.changeEmail.enabledauth.ts.emailVerification.sendVerificationEmailconfiguredisEmailChannelEnabled()is true (R_EMAIL_CHANNEL_ENABLEDis opt-in). Sends via AgentMail; successful delivery is a separate operational requirement.R_ALLOWED_EMAILSrestrictions still apply. Reuse is possible for an admitted signup; anonymous unrestricted registration is not assumed.The new regression completes normal verification and email change, registers a second user at the released address, then replays the stale link without cookies. It is rejected, creates no authenticated session, and changes neither user's address. Upstream's patch binds links to user IDs, stops email-change-link auto-sign-in, and preserves verification only when the prior address was verified; consumers should not rely on the former auto-sign-in side effect.
Impact
Patches both advisory ranges while preserving existing sign-in/provider callback paths and account identities. No intended UI or database schema change. External-provider production smoke testing and effective deployed-config verification remain outstanding; the evidence below supports local compatibility, not a production exposure determination. Do not merge or enable auto-merge as part of this task.
How it was tested
auth, OAuth, email change, real Next-cookie session renewal, auth context, allowlist).084d593f0, not recaptured for this test-only follow-up.pnpm --filter @roomote/web build, webcheck-types:fast, andpnpm lint:fastpassed. Follow-up web types and normal pre-commit/pre-push gates passed, including workspace fast types (27 tasks, 26 cached), residual lint and knip. Production build was not rerun for the test-only change. Initial build emitted filesystem-tracing/Sentry deprecation warnings; install reported the unrelated existing Daytona/AWS peer mismatch, and knip retained an informational docs configuration hint.Download exact test/build/install/policy/pre-push logs.
Follow-up findings assessment and limits · Final tests, expected-failure mutation and push logs.
Screenshots
Real sandbox password form before submission; fixture password is masked.
Authenticated Personal settings after that password sign-in. This is sandbox proof, not external OAuth or production proof.
Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locallypnpm changeset