Summary
better-auth: Device login approval does not show the requesting client or permissions
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.
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.
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.
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.
GHSA-Q84F-53JG-9PPM has a CVSS score of 8.1 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.7.0-rc.3); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
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.
Frequently Asked Questions
- What is GHSA-Q84F-53JG-9PPM? GHSA-Q84F-53JG-9PPM is a high-severity security vulnerability in better-auth (npm), affecting versions >= 1.3.8-beta.3, < 1.7.0-rc.3. It is fixed in 1.7.0-rc.3.
- How severe is GHSA-Q84F-53JG-9PPM? GHSA-Q84F-53JG-9PPM has a CVSS score of 8.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of better-auth are affected by GHSA-Q84F-53JG-9PPM? better-auth (npm) versions >= 1.3.8-beta.3, < 1.7.0-rc.3 is affected.
- Is there a fix for GHSA-Q84F-53JG-9PPM? Yes. GHSA-Q84F-53JG-9PPM is fixed in 1.7.0-rc.3. Upgrade to this version or later.
- Is GHSA-Q84F-53JG-9PPM exploitable, and should I be worried? Whether GHSA-Q84F-53JG-9PPM is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-Q84F-53JG-9PPM is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-Q84F-53JG-9PPM? Upgrade
better-authto 1.7.0-rc.3 or later.