highCVSS 8.7Vulnerability

GHSA-9h47-pqcx-hjr4

### Am I affected? Users are affected if all of the following are true: - Their application uses `better-auth` at a version below the patched release. - Their application enables `oidcProvider()` from `better-auth/plugins/oidc-provider` or `mcp()` from `better-auth/plugins/mcp` (the mcp plugin delegates to `oidcProvider` and inherits both defaults). - For the algorithm-negotiation impact: relying parties of the application's OIDC server use a JWT verification library that performs algorithm negotiation from the discovery document without pinning to a specific signing algorithm. - For the PKCE impact: the authorization URL is exposed to any party other than the user agent and the application's OP. If the application only uses `@better-auth/oauth-provider` (the canonical replacement) and have not enabled the legacy plugins, it is not affected. The new package's discovery document excludes `none` and its authorize schema rejects `plain` at parse time. Fix: 1. Upgrade to `[email protected]` or later. 2. Migrate from the deprecated `oidcProvider` and `mcp` plugins to `@better-auth/oauth-provider` when feasible. 3. If developers cannot upgrade their applications, see workarounds below. ### Summary The legacy `oidcProvider` and `mcp` plugins exhibit two related defects in their OIDC discovery and authorize surfaces. The discovery document advertises `"none"` in `id_token_signing_alg_values_supported` (and, for `mcp`, in `resource_signing_alg_values_supported` on the OAuth protected-resource metadata). Any relying party that performs algorithm negotiation from this metadata without pinning to a real signing algorithm may accept unsigned tokens. PKCE `plain` is enabled by default. The runtime gate in the authorize handler accepts `code_challenge_method=plain` under this default, and a missing `code_challenge_method` parameter is silently downgraded to `"plain"` before the allowlist check. Discovery advertises `code_challenge_methods_supported: ["S256"]`, contradict

Properties

ghsa_id
GHSA-9h47-pqcx-hjr4
summary
Better Auth has insecure cryptographic defaults in oidcProvider: alg=none advertised and plain PKCE accepted by default
severity
high
cvss_score
8.7
cve_id
GHSA-9h47-pqcx-hjr4
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N
is_ghsa_only
true
ghsa_published
2026-07-07T20:55:41Z
source_url
https://github.com/advisories/GHSA-9h47-pqcx-hjr4
ghsa_updated
2026-07-07T20:55:42Z

Related Entities (6)

HAS_WEAKNESS (3)

[Weakness]Initialization of a Resource with an Insecure Default
[Weakness]Selection of Less-Secure Algorithm During Negotiation ('Algorithm Downgrade')
[Weakness]Use of a Broken or Risky Cryptographic Algorithm

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]npm/better-auth

AFFECTS (1)

[Software]npm/better-auth

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-9h47-pqcx-hjr4 (CVSS 8.7) — Ninja Signal Threat Intelligence | Ninja Signal