CVE-2026-67333: Better Auth stored XSS via javascript: redirect_uri in oidc-provider

CVE-2026-67333 · Severity: high · CVSS 7.2 · Published 2026-08-01

Better Auth's oidc-provider plugin (now deprecated) fails to validate the scheme of OAuth redirect URIs during client registration, allowing an attacker to inject a malicious javascript: URL. When a user approves an OAuth consent flow, this crafted URL is returned to the browser and executed in the authorization server's origin, giving the attacker access to the victim's session and enabling account takeover.

Technologies: better-auth (npm). Vendors: npm.

Quick answers

Is CVE-2026-67333 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-67333 being exploited in the wild.
How severe is CVE-2026-67333?
High severity, with a CVSS score of 7.2, published 1 August 2026.
Which products and versions are affected?
better-auth (npm) SEMVER:introduced=0,fixed=1.6.13.
Is there a fix for CVE-2026-67333?
Yes. better-auth (npm): upgrade to 1.6.13 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-67333 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-67333?
Check whether you run better-auth (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • better-auth (npm): upgrade to 1.6.13 or later
    npm install better-auth@1.6.13

Technical details

The vulnerability is a stored XSS in the oidc-provider plugin (deprecated) caused by insufficient input validation on OAuth client redirect URIs. The POST /oauth2/register endpoint accepts redirect_uris as a simple string array without scheme validation, allowing an attacker to store a javascript: URI (e.g., javascript:fetch('/api/auth/get-session')//). During the OAuth authorization-code flow, when a user approves on the consent screen, the handler constructs a URL with the stored malicious redirect_uri, which passes through unchanged and is returned in the JSON response. When the consent page navigates to this value using window.location.href, the javascript: scheme executes in the authorization server origin, exposing the victim's session and enabling account takeover. The attack requires either (a) allowDynamicClientRegistration enabled for unauthenticated registration, or (b) an authenticated attacker to register the client, plus (c) a client-side consent page that navigates to the returned redirectURI. The mcp plugin carries the same defect. Patches are available in better-auth@1.6.13 (stable) and 1.7.0-beta.4 (pre-release).

Affected products

  • Better Auth better-auth < 1.6.13, >= 1.7.0-beta.0 and < 1.7.0-beta.4

Identifiers

  • CVE-2026-67333
  • GHSA-86j7-9j95-vpqj

Timeline

  • 2026-07-07: disclosed: GHSA-86j7-9j95-vpqj published
  • 2026-05-31: advisory: Security advisory published by Better Auth
  • 2026-07-07: patched: Fixed in better-auth@1.6.13 and 1.7.0-beta.4

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.