{"id":"GHSA-q84f-53jg-9ppm","kind":"vulnerability","aliases":["GHSA-q84f-53jg-9ppm"],"related":[],"title":"better-auth: Device login approval does not show the requesting client or permissions","description":"## 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.","summary":"The deviceAuthorization plugin in better-auth 1.3.8-beta.3 through 1.6.x does not show the approving user which client and permissions a device request asks for. An attacker who tricks a signed-in user into approving the attacker's code receives a live Better Auth session token for that user.","severity":"high","cvss":8.1,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"better-auth","fixed":["1.7.0-rc.3"],"affected":">= 1.3.8-beta.3, < 1.7.0-rc.3","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["better-auth","cwe-451","nextjs","node","package","self-hosted"],"not_affected_if":["device-plugin-disabled","patched-1.7.0-or-later"],"how_to_check":"- Run `npm ls better-auth` and check whether the installed version is at least `1.3.8-beta.3` and below `1.7.0-rc.3`.\n- Check whether `deviceAuthorization()` is enabled in the auth configuration.\n- Check whether the bearer plugin or another path accepts the session token returned by the device flow.","fix":"- Upgrade `better-auth` to `1.7.0` or later; no 1.6 release contains the fix.\n- If you built your own approval page, show the requesting client and exact scopes from `GET /device` and keep approval disabled until they load.\n- Until upgraded, disable `deviceAuthorization()` or restrict `/device/code` access, and tell users to reject unexpected device requests.","status":"open","published_at":"2026-10-27T14:49:53+00:00","first_seen_at":"2026-10-27T14:52:49+00:00","triaged_at":"2026-10-27T14:53:47+00:00","updated_at":"2026-10-27T14:53:47+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-10-27T14:53:47Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade `better-auth` to `1.7.0` or later; no 1.6 release contains the fix.\n- If you built your own approval page, show the requesting client and exact scopes from `GET /device` and keep approval disabled until they load.\n- Until upgraded, disable `deviceAuthorization()` or restrict `/device/code` access, and tell users to reject unexpected device requests.","reach":"internet","title":"better-auth: device login approval hides requesting client and permissions from users","impact":"high","summary":"The deviceAuthorization plugin in better-auth 1.3.8-beta.3 through 1.6.x does not show the approving user which client and permissions a device request asks for. An attacker who tricks a signed-in user into approving the attacker's code receives a live Better Auth session token for that user.","category":"package","nicknames":[],"who_cares":["better-auth","node","self-hosted","nextjs"],"confidence":0.85,"needs_auth":"no","worst_case":"attacker takes over a user's account session and reads or changes their data","analyst_note":"","how_to_check":"- Run `npm ls better-auth` and check whether the installed version is at least `1.3.8-beta.3` and below `1.7.0-rc.3`.\n- Check whether `deviceAuthorization()` is enabled in the auth configuration.\n- Check whether the bearer plugin or another path accepts the session token returned by the device flow.","needs_analyst":false,"not_affected_if":["device-plugin-disabled","patched-1.7.0-or-later"],"who_is_affected":"Only applications that enable the opt-in deviceAuthorization() plugin on an affected version are exposed. The risk is greatest where validateClient is not configured or a valid public client can be used, and where the app accepts the session token the device flow returns. Teams that do not enable the device plugin can skip this.","user_interaction":"yes","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000773,"input_tokens":4397,"output_tokens":667,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-451':32B '/device':399C,584C '/device/code':456C,566C '/device/token':640C '1.3.8':46B,105C '1.6':49B,124C,391C '1.7.0':112C,380C,387C '53jg':18A,23A '8628':648C '9ppm':19A,24A 'accept':204C 'access':270C,341C,454C,624C 'account':339C,412C,606C 'action':373C 'activ':360C 'affect':93C,97C,128C,222C,255C,715C 'allow':158C 'allowlist':461C,467C,690C 'alon':468C 'also':135C,679C 'anoth':253C 'applic':203C 'approv':6A,55B,76B,159C,161C,183C,248C,258C,278C,312C,361C,422C,435C,484C,489C,524C,542C,582C,612C,631C,705C 'ask':64B,174C,268C,622C,667C 'attack':67B,78B,138C,150C,298C,303C,314C,328C,343C,354C 'auth':3A,27A,30B,45B,85B,103C,321C,386C,644C 'author':237C,663C 'bearer':217C 'beta.3':47B,106C 'better':2A,26A,29B,44B,84B,102C,320C,385C,643C 'better-auth':1A,25A,28B,43B,101C,384C 'block':452C 'build':486C 'built':419C,614C 'bypass':370C 'call':565C 'cannot':195C,291C,443C,618C 'chang':333C 'check':169C,506C 'client':12A,58B,156C,172C,267C,403C,429C,507C,571C,621C,689C,710C 'code':80B,185C,251C,288C,316C,522C,547C,589C,635C 'compar':196C 'complet':187C 'configur':147C,457C 'confirm':670C 'contain':393C 'convinc':305C 'creat':355C 'cwe':31B 'data':170C,335C 'describ':649C 'detail':558C 'detect':687C 'devic':4A,62B,142C,199C,210C,236C,246C,295C,349C,534C,554C,560C,634C,665C,673C,682C 'deviceauthor':40B,118C,232C,450C 'disabl':436C,449C,525C 'display':512C 'enabl':116C,227C 'endpoint':490C 'even':596C 'exact':177C,516C 'exampl':214C,279C 'expect':539C 'first':377C 'fix':376C,395C 'flow':211C,350C,475C,563C,696C 'follow':448C 'generic':284C 'get':398C,583C 'ghsa':16A,21A 'ghsa-q84f-53jg-9ppm':15A,20A 'give':480C,701C 'given':260C 'help':685C 'host':38B 'id':404C 'identifi':508C,572C,718C 'impact':301C 'imperson':688C 'includ':111C,122C 'inform':259C,485C,528C,683C,706C 'keep':434C,523C 'later':389C 'leav':264C 'let':239C 'limit':470C 'link':189C 'live':83B,319C 'load':439C,529C 'login':5A 'map':504C 'may':95C,182C 'miss':483C,704C 'name':513C 'need':344C 'nextj':33B 'node':34B 'offici':277C 'one':245C 'opt':230C,347C 'opt-in':229C,346C 'origin':633C 'own':414C,608C 'packag':35B 'page':162C,423C,613C 'patch':374C 'pend':495C,579C 'permiss':14A,60B,178C,273C,432C,518C,627C,721C 'phish':652C 'plugin':41B,119C,218C,233C,238C,568C 'possess':677C 'public':155C,709C 'q84f':17A,22A 'rang':121C 'rc.3':113C,381C 'read':331C,493C 'receiv':81B,317C 'recommend':655C,680C 'redeem':638C 'reduc':691C 'reject':533C 'releas':125C,392C 'reli':464C 'remot':651C 'request':11A,63B,143C,180C,285C,300C,352C,402C,416C,496C,517C,535C,575C,580C,610C,720C 'respons':617C 'return':212C,400C,585C 'rfc':647C 'right':550C 'scenario':653C 'scope':406C,576C 'self':37B 'self-host':36B 'server':168C,500C,658C 'server-check':167C 'server-sid':499C 'session':86B,206C,322C,602C,645C 'ship':378C 'short':250C 'show':9A,53B,165C,281C,427C,514C,619C,681C 'shown':724C 'side':501C 'sign':72B,242C,308C,368C,410C,600C 'sign-in':367C 'signed-in':71B,307C,409C,599C 'start':140C,193C,473C,561C,694C 'status':592C 'still':713C 'storag':502C 'store':569C 'strict':459C 'summari':234C 'technic':557C 'tell':292C,530C,659C 'therefor':280C,712C 'token':87B,207C,323C,646C 'trick':69B 'true':136C,595C 'trust':498C,511C 'untrust':453C 'updat':424C 'upgrad':382C,397C,444C 'use':100C,152C 'user':56B,74B,90B,181C,241C,263C,290C,310C,326C,337C,358C,372C,481C,521C,531C,588C,605C,660C,686C,702C 'valid':154C,708C 'validatecli':144C,460C 'verif':188C 'version':256C 'visibl':549C 'want':275C,629C 'without':371C 'workaround':440C 'x':50B 'yet':445C","nicknames":[],"mitigations":[],"who_affected":"Only applications that enable the opt-in deviceAuthorization() plugin on an affected version are exposed. The risk is greatest where validateClient is not configured or a valid public client can be used, and where the app accepts the session token the device flow returns. Teams that do not enable the device plugin can skip this.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-27T14:49:53+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-q84f-53jg-9ppm","url":"https://github.com/advisories/GHSA-q84f-53jg-9ppm","severity":"high","published_at":"2026-10-27T14:49:53+00:00","modified_at":"2026-10-27T14:49:54+00:00","first_seen_at":"2026-10-27T14:52:49+00:00","fetched_at":"2026-10-27T14:52:49+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}