In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade better-auth to version 1.6.2 or higher.
better-auth is a The most comprehensive authentication library for TypeScript.
Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) when building an errorURL in parseGenericState, when the storeStateStrategy is set to "cookie" and PKCE is disabled. An attacker can gain unauthorized access to a victim's session or link their external account to the victim's authenticated account by convincing a user to follow a malicious OAuth callback URL with a forged state and arbitrary code, while the target browser holds a valid oauth_state cookie.
This vulnerability can be avoided by setting the storeStateStrategy to "database" or enabling PKCE (pkce: true) on all affected OAuth providers.