GHSA-q84f-53jg-9ppm CVE-2026-109346
better-auth: Device login approval does not show the requesting client or permissions
- Severity
- 8.5 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 0.28%
- Chance of exploitation in the next 30 days. Higher than 20.30% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-451 User Interface (UI) Misrepresentation of Critical Information
- Fix
1.7.0-rc.3- Upgrade better-auth to this version or later
Description
Am I affected?
You may be affected if you use better-auth from 1.3.8-beta.3 up to, but not including, 1.7.0-rc.3, and you enable the deviceAuthorization() plugin. This range includes all 1.6 releases.
You are affected only if all of these are also true:
- An attacker can start a device request:
validateClientis not configured, or the attacker can use a valid public client. - Before allowing approval, your approval page does not show, from server-checked data, which client is asking and the exact permissions it requests.
- Users may approve a code or complete verification link they did not start and cannot compare with a device they have.
- Your application accepts the session token that the device flow returns, for example through the bearer plugin.
You are not affected if you do not enable the opt-in deviceAuthorization() plugin.
Summary
The device authorization plugin lets a user sign in on one device by approving a short code on another. In affected versions, the approval information given to the user leaves out which client asked for access and which permissions it wants. The official approval examples therefore show only a generic request and a code, so users cannot tell their own device from an attacker's request.
Impact
An attacker who convinces a signed-in user to approve the attacker's code receives a live Better Auth session token for that user. The attacker can then read or change any data the user's account can access. The attack needs the opt-in device flow, a request the attacker creates, and a user who actively approves it; it is not a sign-in bypass without user action.
Patches
The fix first shipped in 1.7.0-rc.3. Upgrade to better-auth@1.7.0 or later. No 1.6 release contains the fix.
After upgrading, GET /device returns the requesting client_id and scope to the signed-in account that owns the request. If you built your own approval page, update it to show that client and those permissions, and keep approval disabled until they load.
Workarounds
If you cannot upgrade yet, do the following:
- Disable
deviceAuthorization(), or block untrusted access to/device/code. - Configure a strict
validateClientallowlist. Do not rely on the allowlist alone: it limits who can start the flow, but it does not give users the missing approval information. - Build your own approval endpoint. It should read the pending request from trusted server-side storage and map the checked client identifier to a trusted display name. Show the exact requested permissions and the user code. Keep approval disabled until this information loads.
- Tell users to reject device requests they did not expect. They should approve only when the same code is visible right now on a device they have.
Technical details
A device starts the flow by calling /device/code. The plugin stores the client identifier and any requested scope with the pending request. Before approval, GET /device returns only the user code and its status. This is true even for a signed-in session of the user account that owns the request. An approval page built from that response cannot show which client asked for access or which permissions it wants. After approval, the original device code can be redeemed at /device/token for a Better Auth session token.
RFC 8628 describes this remote phishing scenario. It recommends that the server tell users they are authorizing a device and ask them to confirm that the device is in their possession. It also recommends showing device information that helps users detect impersonation. Client allowlisting reduces who can start the flow, but it does not give users the missing approval information. A valid public client can therefore still be affected when its identifier and requested permissions are not shown.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| better-auth | >= 1.3.8-beta.3, < 1.7.0-rc.3 |
1.7.0-rc.3 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
better-auth npm → 1.7.0-rc.3
- npm
npm install better-auth@1.7.0-rc.3- yarn
yarn add better-auth@1.7.0-rc.3- pnpm
pnpm add better-auth@1.7.0-rc.3
Severity breakdown
CVSS 4.0 8.5
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- Active
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
- Exploit maturity
- Not defined
- Scope
- X
CVSS 3.1 8.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Weakness
CWE-451: User Interface (UI) Misrepresentation of Critical Information
The user interface (UI) does not properly represent critical information to the user, allowing the information - or its source - to be obscured or spoofed. This is often a component in phishing attacks.
How to prevent it
- Implementation: Perform data validation (e.g. syntax, length, etc.) before interpreting the data.
- Architecture and Design: Create a strategy for presenting information, and plan for how to display unusual characters.
References
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-r4xp-prcw-77qf better-auth: OAuth Proxy lets an attacker sign in as another user | Critical | Also affects better-auth |
| GHSA-965c-763c-88jm better-auth: OAuth state can be used as a Magic Link to sign in as another user | Critical | Also affects better-auth |
| GHSA-44jh-23m7-hpcf @better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL | Medium | Also affects better-auth |
| GHSA-qq9h-g4jm-xgf3 Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in | High | Also affects better-auth |
| GHSA-2vg6-77g8-24mp Better Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flows | Medium | Also affects better-auth |
| GHSA-7w99-5wm4-3g79 @better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitive | High | Also affects better-auth |
| GHSA-392p-2q2v-4372 Better Auth: OAuth refresh-token rotation forks the token family on concurrent redemption | High | Also affects better-auth |
| GHSA-9h47-pqcx-hjr4 Better Auth has insecure cryptographic defaults in oidcProvider: alg=none advertised and plain PKCE accepted by default | Critical | Also affects better-auth |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor