Better Auth: Device authorization approve and deny accept any authenticated session while the user code is pending
better-auth
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| better-auth npm |
|
|
Original description
Better Auth is an authentication and authorization library for TypeScript. From 1.6.0 until 1.6.11, the deviceAuthorization plugin treats any authenticated session as the owner of any pending device code because GET /device does not claim the row and POST /device/approve and POST /device/deny short-circuit when userId is unset, allowing an authenticated attacker who learns a valid user_code to bind the polling device to the attacker's account or deny the legitimate flow. This issue is fixed in version 1.6.11.
From the CVE record · GitHub_M
References
- github.com/better-auth/better-auth/security/advisories/GHSA-cq3f-vc6p-68fhVendor advisory
- github.com/better-auth/better-auth/pull/9573Patch
- github.com/better-auth/better-auth/commit/99a254a79b59d5a3f5ca2123260118cddb5beed7Patch
- github.com/better-auth/better-auth/releases/tag/v1.6.11Release notes
- github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45337.json
- nvd.nist.gov/vuln/detail/CVE-2026-45337
- github.com/better-auth/better-auth