criticalCVSS 9.1Vulnerability

CVE-2026-53512

### Am I affected? Users are affected if all of the following are true: - Their application uses `better-auth` and has enabled at least one of: `oidcProvider()` (imported from `better-auth/plugins/oidc-provider`), or `mcp()` (imported from `better-auth/plugins/mcp`). - Their application has at least one confidential OAuth client registered (any client with `type: "web" | "native" | "user-agent-based"` in the `oauthApplication` table, or any `trustedClients` entry without `type: "public"`). Public clients with PKCE are not affected. - Their application uses `better-auth` at a version below the patched release. If an application only uses `@better-auth/oauth-provider` (the canonical replacement for `oidc-provider`) and the `mcp` plugin is not enabled, it is not affected. Fix: 1. Upgrade to `[email protected]` or later. 2. Migrate from the deprecated `oidcProvider()` to `@better-auth/oauth-provider` when feasible. The new package enforces client authentication on both grants by default. 3. If developers cannot upgrade their applications, see workarounds below. ### Summary The legacy `oidcProvider` and `mcp` plugins each expose an OAuth 2.0 token endpoint whose `refresh_token` grant authenticates the request entirely on possession of the bound `refreshToken` row and a matching `client_id`. Neither plugin verifies the registered confidential client's `client_secret` on the refresh path. An attacker who obtains any valid `refresh_token` (via database read, log capture, browser-side XSS, or CORS-amplified script in the mcp case) and the public `client_id` can mint fresh access tokens and rotated refresh tokens until the chain is revoked. ### Details RFC 6749 §6 and OAuth 2.1 §4.3 require confidential clients to authenticate to the token endpoint on every grant, including refresh. The same plugins' `authorization_code` grant correctly enforces `client_secret` (the oidc-provider via `verifyStoredClientSecret`, the mcp plugin via raw equality), which proves the omis

Properties

severity
critical
summary
Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
epss_score
0.00213
cvss_score
9.1
ghsa_published
2026-07-07T20:11:50Z
source_url
https://github.com/advisories/GHSA-pw9m-5jxm-xr6h
ghsa_updated
2026-07-07T20:11:52Z
ghsa_id
GHSA-pw9m-5jxm-xr6h
cve_id
CVE-2026-53512
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
is_ghsa_only
false
epss_percentile
0.11863

Related Entities (8)

ENRICHED_BY (1)

[Source]FIRST EPSS

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]npm/better-auth

AFFECTS (1)

[Software]npm/better-auth

HAS_WEAKNESS (4)

[Weakness]Improper Authentication
[Weakness]Incorrect Authorization
[Weakness]Insufficient Verification of Data Authenticity
[Weakness]Missing Authentication for Critical Function

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-53512 (CVSS 9.1) — Ninja Signal Threat Intelligence | Ninja Signal