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

Source: https://junglewise.ai/threats/cve-2026-67333-better-auth-stored-xss-via-javascript-redirect-uri-in-oidc  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/better-auth). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/better-auth/better-auth/security/advisories/GHSA-86j7-9j95-vpqj](https://github.com/better-auth/better-auth/security/advisories/GHSA-86j7-9j95-vpqj)
- [https://github.com/better-auth/better-auth](https://github.com/better-auth/better-auth)

## Related threats

- [Better Auth authentication bypass in Magic Link and OAuth](https://junglewise.ai/threats/cve-2026-114607-better-auth-is-an-authentication-and-authorization-library-for)
- [Better Auth OAuth Proxy authentication bypass](https://junglewise.ai/threats/cve-2026-110864-better-auth-from-1-5-0-beta-12-before-1-7-7-contains-an)
- [Better Auth authentication bypass via OAuth state reuse](https://junglewise.ai/threats/cve-2026-110862-better-auth-from-1-4-0-beta-18-before-1-7-7-contains-an)
- [@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL](https://junglewise.ai/threats/cve-2026-110861-better-auth-better-auth-drizzle-adapter-and-better-auth-from-1-6)
- [better-auth device authorization UI misrepresentation in deviceAuthorization plugin](https://junglewise.ai/threats/cve-2026-109346-better-auth-from-1-3-8-beta-3-before-1-7-0-rc-3-contains-a-ui)
