@better-auth/electron is vulnerable to Information Disclosure
81
CVE Score
High
Information Disclosure
The Electron plugin accepts any validly signed cookie under its desktop transfer cookie name, because the signature does not cover the cookie name. When no valid transfer request is found, its after hook returns the whole endpoint context as the sign-in response, leaking the auth secret and social provider client secrets to any user who can sign in. With the auth secret, an attacker can forge signed values and obtain a session as another user whose email they know. Separately, when electron() is registered before twoFactor(), a desktop authorization code is created right after the password check and before the second factor is verified. That code can be exchanged for a full session, bypassing two-factor authentication.
Upgrade the @better-auth/electron library to the patch version, and upgrade better-auth to 1.7.16. If the plugin has been running, treat the auth secret and every social provider client secret as disclosed and rotate them.
You are affected if you are using a version that falls within the vulnerable range and your server registers the electron() plugin. The two-factor bypass additionally requires twoFactor() to be registered after electron() in the plugins array, with users who have two-factor enabled able to sign in with a password.
1.5.0 - 1.7.15
Fixed in 1.7.16@better-auth/electron is vulnerable to Information Disclosure in versions 1.5.0 - 1.7.15.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.