GHSA-9HM7-XHFP-CX58
better-auth: OAuth sign-in can treat an unverified provider email as verified
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-9HM7-XHFP-CX58 divulgada · CVSS 5.9 (GitHub) | |
| Remediación | Parche 1.7.16 | better-auth · 0 d desde divulgación | |
| Remediación | Parche 1.8.0-beta.5 | better-auth · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Am I affected?
You are affected if you use OAuth sign-in from `better-auth` 0.4.9 or later and any of these is true:
- A provider sends `email_verified` as a string and lets its users keep an unverified address. Amazon Cognito's user info endpoint is one example.
- You use `genericOAuth()` with a provider that has a JWKS endpoint.
- You use the Zoom provider with `disableSignUp`, `requireEmailVerification`, or `overrideUserInfoOnSignIn`.
You are not affected for providers listed in `account.accountLinking.trustedProviders`, where linking by email is intended.
Summary
String claims. Better Auth treated any non-empty `email_verified` value as verified, so the string `"false"` passed.
Profile and token mismatch. With generic OAuth, the user info profile was not checked against the ID token's subject, and direct ID-token sign-in could load the profile from a submitted access token.
Zoom options. The Zoom provider ignored its configured provider options.
Impact
Someone who can hold another person's address unverified at an affected provider can sign in and be linked to the local account that owns it, and gets a session for that account. Accounts created this way are marked verified. A profile mismatch can attach a different provider identity than the one the ID token names. On Zoom, closed registration and email verification requirements did not apply.
Patches
Upgrade `better-auth` to 1.7.16, or to 1.8.0-beta.5 on the beta line.
An email now counts as verified only when the claim is `true` or the string `"true"`, including values returned from `mapProfileToUser`.
Workarounds
For a provider that sends string claims, provide a `getUserInfo` function that converts `email_verified` to a boolean. For Zoom, turn off the provider if you rely on the ignored options.
Technical details
The linking code tested `emailVerified` for truthiness when deciding whether an untrusted provider may link to an existing user and when storing the value for a new user. It now normalizes the claim at those points. Generic OAuth providers with a `jwks_uri` now reject a profile whose `sub` differs from the ID token, and ID-token sign-in ignores submitted access and refresh tokens. Direct ID-token sign-in already applied `disableSignUp` from 1.7.7. This release applies the Zoom provider's options the same way.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmbetter-auth |
Corregida | 1.7.16, 1.8.0-beta.5 | 0 d · 0 d | 1.7.26 no afectada |
1.7.161.8.0-beta.5Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/better-auth/better-auth/security/advisories/GHSA-9hm7-xhfp-cx58Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
