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.
Published: 2026-07-15
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Sat, 18 Jul 2026 01:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
First Time appeared Better-auth
Better-auth better Auth
Vendors & Products Better-auth
Better-auth better Auth

Wed, 15 Jul 2026 17:30:00 +0000

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'}


Subscriptions

Better-auth Better Auth
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-18T01:08:08.419Z

Reserved: 2026-06-09T17:30:33.455Z

Link: CVE-2026-53512

cve-icon Vulnrichment

Updated: 2026-07-18T01:08:04.087Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T03:15:05Z

Weaknesses
  • CWE-287

    Improper Authentication

  • CWE-306

    Missing Authentication for Critical Function

  • CWE-345

    Insufficient Verification of Data Authenticity

  • CWE-863

    Incorrect Authorization