Insecure Cryptographic Defaults in better-auth OIDC and MCP Plugins
better-auth versions before 1.6.11 enable insecure OIDC and PKCE configurations by default, allowing attackers to bypass authentication through algorithm negotiation and authorization code interception.
better-auth versions prior to 1.6.11 contain insecure cryptographic defaults within the oidcProvider and mcp plugins. The vulnerability stems from the library advertising the none algorithm for OpenID Connect (OIDC) tokens and defaulting to plain Proof Key for Code Exchange (PKCE) rather than the industry-standard S256 method.
This misconfiguration enables remote attackers to manipulate the algorithm negotiation process, forcing the application to accept unsigned tokens. Furthermore, the reliance on plain PKCE allows adversaries to intercept authorization codes, leading to potential full authorization bypass. The impact is significant for applications relying on better-auth for secure authentication and authorization flows, as it effectively negates the security guarantees provided by OIDC and PKCE. Defenders should immediately audit environments for better-auth versions below 1.6.11 and prioritize upgrades.
Impact
Successful exploitation allows for full authentication bypass and unauthorized access to sensitive application data. By manipulating the OIDC token exchange, attackers can impersonate legitimate users and escalate privileges within systems integrated with the vulnerable better-auth plugins. This flaw exposes authentication services to high-risk interception and token forgery attacks.
Recommendation
- Upgrade the
better-authlibrary to version 1.6.11 or higher across all development and production environments. - Audit all
oidcProviderconfigurations to ensure that thenonealgorithm is explicitly disabled and thatcode_challenge_methodis set strictly toS256. - Conduct a security review of authentication logs for anomalous token validation patterns or usage of
plainPKCE challenges in the OAuth flow. - Monitor dependencies using software composition analysis (SCA) tools to ensure that vulnerable versions of better-auth are identified and patched immediately.