Skip to content
PatchBriefing

Search PatchBriefing

Type at least two characters. Results update as you type.

Search CVEs, products, packages and article titles.

Nothing found. Identifiers such as CVE and GHSA can be searched in both languages.

Subscribe

Critical · 9.1 Node.js & npm CVE-2026-114607 GHSA-965c-763c-88jm GHSA-q84f-53jg-9ppm GHSA-r4xp-prcw-77qf

Three better-auth Vulnerabilities Allow Account Takeover and Device-Approval Phishing

Three vulnerabilities in the better-auth npm package affect OAuth Proxy, Magic Link, and the device authorization plugin, with two rated critical (CVSS 9.1 and 7.4) allowing account takeover and one (CVSS 8.1) enabling device-approval phishing. Fixes are available in version 1.7.7 for two issues and 1.7.0 for the third.

By PatchBriefing · ·

Produced automatically from official sources with the help of AI. How we work →

AI summary

Three security advisories for better-auth, a TypeScript authentication and authorization library, were published on the same day. Two of the issues involve authentication logic flaws that can let an unauthenticated attacker obtain a valid session for another user's account under specific, non-default configurations. The third concerns a user interface problem in the device authorization plugin that can be exploited through phishing. This briefing covers all three so site owners can assess exposure and apply the appropriate fixes.

What happened

Three distinct vulnerabilities were disclosed for better-auth. The first (GHSA-965c-763c-88jm / CVE-2026-114607) involves a conflict between Magic Link verification records and OAuth sign-in state when both features share certain configuration settings; an attacker can start an OAuth sign-in for a known email address and redeem the resulting state value as if it were a Magic Link token, without access to the victim's mailbox. The second (GHSA-r4xp-prcw-77qf) affects the OAuth Proxy plugin, which can be tricked into accepting an attacker-crafted profile for another user's email address when the proxy secret is not distinct from the environment's global secret and sign-in state is stored in a cookie. The third (GHSA-q84f-53jg-9ppm) affects the device authorization plugin: the approval screen shown to users does not display which client application is requesting access or what permissions it is asking for, which can let an attacker trick a signed-in user into approving a device request the attacker initiated.

Technical cause

In the Magic Link/OAuth state issue, specific combinations of the storeToken and verification.storeIdentifier settings, combined with a database-backed storeStateStrategy and an enabled social or Generic OAuth provider, cause Magic Link verification records and OAuth state to resolve to the same stored identifier (CWE-287, Improper Authentication). In the OAuth Proxy issue, the plugin trusts any profile it can decrypt; if the proxy has no dedicated secret or reuses the global Better Auth secret, and sign-in state is cookie-based with implicit account linking enabled (the default), an attacker can craft a decryptable profile for a target email address (also CWE-287). In the device authorization issue, the `GET /device` endpoint returns only the user code and its status, not the requesting client_id or scope, even to the signed-in account that owns the request (CWE-451, UI Misrepresentation of Critical Information). This prevents users from distinguishing a legitimate device request from one started by an attacker.

Why it matters

The OAuth state/Magic Link flaw (CVSS 9.1) and the OAuth Proxy flaw (CVSS 7.4) both allow an attacker without an account to obtain a working session for another user by knowing only their verified email address, with no action required from the victim in the first case. This can lead to full read and write access to the victim's account data. The device authorization flaw (CVSS 8.1) requires a user to actively approve a request, but if successful, the attacker receives a live session token with the same access as the victim. None of the three issues affect availability, and none have been reported as actively exploited.

Who is affected

For the OAuth state/Magic Link issue: deployments running better-auth versions from 1.4.0-beta.18 up to but not including 1.7.7 that have Magic Link enabled with specific storeToken/verification.storeIdentifier combinations, a social or Generic OAuth provider enabled, and account.storeStateStrategy set to database. For the OAuth Proxy issue: deployments running versions from 1.5.0-beta.12 up to but not including 1.7.7 using the OAuth Proxy plugin without a distinct dedicated secret, with cookie-based sign-in state storage and implicit account linking enabled (default). For the device authorization issue: deployments running versions from 1.3.8-beta.3 up to but not including 1.7.0-rc.3 that have the deviceAuthorization() plugin enabled, do not restrict which clients can start a device request, and whose approval page does not independently display the requesting client and permissions.

Fixes and mitigation

For the OAuth state/Magic Link issue and the OAuth Proxy issue, the fix is included in better-auth 1.7.7; all nodes and environments sharing the same cookie-backed state flow or proxy configuration should be upgraded together, and pending sign-in and account-linking flows will need to be restarted since pre-upgrade state cookies and proxy payloads are rejected after the update. Until upgrading, operators can mitigate the OAuth Proxy issue by setting a strong, distinct OAuth Proxy secret per environment, switching account.storeStateStrategy to database (the default when a database or secondary storage is configured), or removing the OAuth Proxy plugin if unused; setting account.accountLinking.disableImplicitLinking to true reduces impact but does not fix the underlying flaw. For the device authorization issue, the fix shipped in 1.7.0; after upgrading, GET /device returns the requesting client_id and scope so approval pages can display this information. Until upgrading, operators can disable deviceAuthorization(), restrict access to /device/code, configure a strict validateClient allowlist (which alone does not solve the missing-information problem), or build a custom approval page that displays the verified client identity and requested permissions before allowing approval.

Recommended action

Site owners running better-auth should first determine which of the three features are in use: Magic Link, OAuth Proxy, and deviceAuthorization(). If any are enabled, check the version in use against the affected ranges above and upgrade to better-auth 1.7.7 to resolve the OAuth state/Magic Link and OAuth Proxy issues, or 1.7.0 or later to resolve the device authorization issue. Since 1.7.7 is a later release than 1.7.0, upgrading to 1.7.7 addresses all three issues. Where immediate upgrade is not possible, apply the documented workarounds for each affected plugin without delay, and review configuration settings described in the technical cause section to confirm whether the vulnerable combination is present.

PatchBriefing score

9.1 / 10 · Critical

Official CVSS: 9.1

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

EPSS 0.0063 (45 percentile)

Why this score

The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.

Affected versions

better-auth >= 1.4.0-beta.18, < 1.7.7
vulnerable
≥ 1.7.7
patched
better-auth >= 1.3.8-beta.3, < 1.7.0-rc.3
vulnerable
≥ 1.7.0-rc.3
patched
better-auth >= 1.5.0-beta.12, < 1.7.7
vulnerable
≥ 1.7.7
patched

Reported fixes

For the OAuth state/Magic Link issue and the OAuth Proxy issue, the fix is included in better-auth 1.7.7; all nodes and environments sharing the same cookie-backed state flow or proxy configuration should be upgraded together, and pending sign-in and account-linking flows will need to be restarted since pre-upgrade state cookies and proxy payloads are rejected after the update. Until upgrading, operators can mitigate the OAuth Proxy issue by setting a strong, distinct OAuth Proxy secret per environment, switching account.storeStateStrategy to database (the default when a database or secondary storage is configured), or removing the OAuth Proxy plugin if unused; setting account.accountLinking.disableImplicitLinking to true reduces impact but does not fix the underlying flaw. For the device authorization issue, the fix shipped in 1.7.0; after upgrading, GET /device returns the requesting client_id and scope so approval pages can display this information. Until upgrading, operators can disable deviceAuthorization(), restrict access to /device/code, configure a strict validateClient allowlist (which alone does not solve the missing-information problem), or build a custom approval page that displays the verified client identity and requested permissions before allowing approval.

How this was built

4 source records were collected, matched and used to prepare the report above.

  • NVD (NIST) database
  • GitHub Advisory Database database
  • GitHub Advisory Database database
  • GitHub Advisory Database database
Unified report
Three better-auth Vulnerabilities Allow Account Takeover and Device-Approval Phishing
1 article · 4 sources cited
Revision history
  1. Published
  2. Generated
  3. Merged
  4. Published
  5. Generated
The Morning Brief

Relevant changes for the stacks you follow.

Choose your stacks, topics and optional WordPress plugins. At 07:00 CET, matching advisories and releases from the reporting period are grouped into one email.

✓ Choose stacks and topics✓ Change preferences anytime✓ One grouped email