CVE-2026-53512

Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins

Published Jul 15, 2026 CVSS 4.0 · 9.1 Critical EPSS < 1% KEV · Not listed
Description
Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.11, the legacy oidcProvider and mcp plugins expose OAuth token endpoints whose refresh_token grant authenticates only possession of the bound refreshToken row and matching client_id, without verifying the confidential client's client_secret, allowing an attacker with a valid refresh_token to mint access tokens and rotated refresh tokens through /api/auth/oauth2/token or /api/auth/mcp/token. The @better-auth/oauth-provider package is not affected. This issue is fixed in version 1.6.11.

Analysis

AI-generated

Technical impact

This flaw, a CWE‑287: Improper Authentication, lies in the refresh_token grant of the legacy oidcProvider and mcp plugins of Better Auth. The server verifies only the existence of a bound refresh token and a matching client_id but fails to enforce the confidential client's client_secret. The likely attack vector is that an attacker who possesses a valid refresh token can send a request to the exposed /api/auth/oauth2/token or /api/auth/mcp/token endpoints without providing a client_secret, thereby obtaining new access tokens and rotated refresh tokens. This authentication bypass permits unauthorized token issuance, enabling an attacker to acquire credentials that could be used to access protected resources.

Affected Systems

This issue targets the Better Auth authentication library for TypeScript, specifically the legacy oidcProvider and mcp plugins in any release prior to version 1.6.11. The @better-auth/oauth-provider package is not affected. Systems that have installed the older plugins and expose the /api/auth/oauth2/token or /api/auth/mcp/token endpoints without requiring client_secret verification are at risk.

Risk and Exploitability

The CVSS score of 9.1 indicates high severity. The EPSS score of less than 1% suggests low current exploitation likelihood, and the vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that an attacker would need a legitimate refresh token and then send a request to the token endpoint without providing a client_secret. Once the token is in hand, the exploit path is straightforward and requires no additional privileged access or complex preparation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Better Auth to version 1.6.11 or later, which validates client_secret during refresh_token requests.
  • Configure the deployment so that the /api/auth/oauth2/token and /api/auth/mcp/token endpoints enforce client authentication, rejecting requests that lack a valid client_secret.
  • Implement rate limiting and monitoring on token issuance endpoints to detect and mitigate abuse of the refresh_token grant.
  • Disable or remove the legacy oidcProvider and mcp plugins if they are no longer needed, thereby eliminating the vulnerable code paths.
  • Rotate existing client secrets and enforce a short token lifetime to limit the window of opportunity for a compromised refresh token.

Generated by OpenCVE AI on August 3, 2026 at 03:01 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-pw9m-5jxm-xr6h Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Better-auth
Better-auth better Auth
Vendors & Products Better-auth
Better-auth better Auth
Type Values Removed Values Added
Description Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.11, the legacy oidcProvider and mcp plugins expose OAuth token endpoints whose refresh_token grant authenticates only possession of the bound refreshToken row and matching client_id, without verifying the confidential client's client_secret, allowing an attacker with a valid refresh_token to mint access tokens and rotated refresh tokens through /api/auth/oauth2/token or /api/auth/mcp/token. The @better-auth/oauth-provider package is not affected. This issue is fixed in version 1.6.11.
Title Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
Weaknesses CWE-287
CWE-306
CWE-345
CWE-863
References
Metrics cvssV4_0

{'score': 9.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-287

    Improper Authentication

  • CWE-306

    Missing Authentication for Critical Function

  • CWE-345

    Insufficient Verification of Data Authenticity

  • CWE-863

    Incorrect Authorization

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 18, 2026, 1:08 AM
Reserved
Jun 9, 2026, 5:30 PM
Status
Analyzed
Published
Jul 15, 2026, 6:16 PM
Modified
Jul 21, 2026, 1:33 PM