{"id":"GHSA-q84f-53jg-9ppm","summary":"better-auth: Device login approval does not show the requesting client or permissions","details":"## Am I affected?\n\nYou 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.\n\nYou are affected only if all of these are also true:\n\n- An attacker can start a device request: `validateClient` is not configured, or the attacker can use a valid public client.\n- Before allowing approval, your approval page does not show, from server-checked data, which client is asking and the exact permissions it requests.\n- Users may approve a code or complete verification link they did not start and cannot compare with a device they have.\n- Your application accepts the session token that the device flow returns, for example through the bearer plugin.\n\nYou are not affected if you do not enable the opt-in `deviceAuthorization()` plugin.\n\n## Summary\n\nThe 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.\n\n## Impact\n\nAn 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.\n\n## Patches\n\nThe 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.\n\nAfter 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.\n\n## Workarounds\n\nIf you cannot upgrade yet, do the following:\n\n- Disable `deviceAuthorization()`, or block untrusted access to `/device/code`.\n- Configure a strict `validateClient` allowlist. Do not rely on the allowlist alone: it limits who can start the flow, but it does not give users the missing approval information.\n- 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.\n- 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.\n\n## Technical details\n\nA 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.\n\nRFC 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.","aliases":["CVE-2026-109346"],"modified":"2026-10-27T15:00:04.493157049Z","published":"2026-10-27T14:49:53Z","database_specific":{"cwe_ids":["CWE-451"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-10-27T14:49:53Z","nvd_published_at":null},"references":[{"type":"WEB","url":"https://github.com/better-auth/better-auth/security/advisories/GHSA-q84f-53jg-9ppm"},{"type":"WEB","url":"https://github.com/better-auth/better-auth/commit/f68044dcfbd9fb83763249ed9509cfacbcce47be"},{"type":"PACKAGE","url":"https://github.com/better-auth/better-auth"},{"type":"WEB","url":"https://github.com/better-auth/better-auth/releases/tag/v1.7.0-rc.3"}],"affected":[{"package":{"name":"better-auth","ecosystem":"npm","purl":"pkg:npm/better-auth"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.3.8-beta.3"},{"fixed":"1.7.0-rc.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-q84f-53jg-9ppm/GHSA-q84f-53jg-9ppm.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"}]}