GHSA-q84f-53jg-9ppm: better-auth: Device login approval does not show the requesting client or permissions
better-auth's opt-in `deviceAuthorization()` plugin does not tell the approving user which client is asking or what permissions it wants. An attacker who tricks a signed-in user into approving the attacker's code gets a live session token for that user. Apps on 1.3.8-beta.3 up to 1.7.0-rc.3 (all 1.6 releases) are affected. The fix first shipped in 1.7.0-rc.3. The advisory says to upgrade to 1.7.0 or later.
Published Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
The device flow lets a user sign in on one device by approving a short code on another. A device calls /device/code, and the plugin stores the client identifier and requested scope with the pending request. Before the fix, GET /device returned only the user code and its status, even to the signed-in owner of the request. An approval page built on that response cannot show the client or the scope. The official approval examples show only a generic request and a code.
The attacker starts a device request, then persuades a victim to approve the code, for example by sending a verification link. After approval, the attacker redeems the device code at /device/token and receives a Better Auth session token. If your app accepts that token, for example through the bearer plugin, the attacker can read or change anything the victim's account can reach. RFC 8628 calls this remote phishing.
The attack needs the plugin enabled, a user who actively approves, and either no validateClient configured or a valid public client. It is not a sign-in bypass without user action. That is why the vector has user interaction required (CWE-451).
Who is affected
Affected: better-auth from 1.3.8-beta.3 up to but not including 1.7.0-rc.3, which includes every 1.6 release. You are exposed only if you enable deviceAuthorization(), an attacker can start a request, your approval page does not show server-checked client and permission data, and your app accepts the session token the flow returns.
Check the installed version:
npm ls better-authThen search your code for deviceAuthorization( to see whether the plugin is on.
better-auth
- Ecosystem
- npm
- Affected
- >= 1.3.8-beta.3, < 1.7.0-rc.3
- Fixed in
- 1.7.0-rc.3
- Check
npm ls better-auth
How to fix it
The fix first shipped in 1.7.0-rc.3. The advisory recommends [email protected] or later. No 1.6 release contains the fix.
npm install better-auth@latestAfter 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, show that client and those permissions, and keep approval disabled until they load.
Workarounds if you cannot upgrade:
- Disable
deviceAuthorization()or block untrusted access to/device/code. - Set a strict
validateClientallowlist. This limits who can start the flow but does not give users the missing information. - Build your own approval endpoint that reads the pending request from trusted server storage and shows a trusted client name, the exact permissions and the user code.
- Tell users to approve only a code visible right now on a device they hold.
How to tell if you were hit
Review your logs for /device/code requests from unknown clients or from clients not in your allowlist. Look for /device/token redemptions shortly after a user approval, followed by session use from an unfamiliar IP or user agent.
Check your device-code and session tables for sessions created through the device flow that the user did not start. Users who received an unexpected verification link or code are the likely victims. Revoke their sessions.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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 [email protected] 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.
Credited to XlabAITeam, keenanwgn, liangjs.
Questions
- Am I affected if I do not use deviceAuthorization()?
No. The advisory says you are not affected unless you enable the opt-in
deviceAuthorization()plugin.- Is a strict validateClient allowlist enough?
No. The advisory says the allowlist limits who can start the flow but does not give users the missing approval information. A valid public client can still be abused.
- Is there a fix for better-auth 1.6?
No. The advisory states that no 1.6 release contains the fix. Move to 1.7.0 or later, or apply the workarounds.
- Does the attacker need the victim to click something?
Yes. The victim must be signed in and actively approve the attacker's code. Without that approval the attacker gets no session.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-114607
better-auth: OAuth state can be used as a Magic Link to sign in as another user
critical9.1Oct 27, 2026GHSA-44jh-23m7-hpcf
@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL
low3.7Oct 27, 2026GHSA-r4xp-prcw-77qf
better-auth: OAuth Proxy lets an attacker sign in as another user
high7.4Oct 27, 2026GHSA-qq9h-g4jm-xgf3
Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in
high8.3Jul 24, 2026CVE-2026-53512
Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
critical9.1Jul 7, 2026CVE-2026-53514
Better Auth vulnerable to unauthorized invitation acceptance via unverified email match in organization plugin
high7.7Jul 7, 2026
