Description
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.
Published: 2026-08-01
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

better-auth prior to version 1.6.13, including pre‑release 1.7.0‑beta.0 to 1.7.0‑beta.3, fails to validate the URI scheme for redirect_uris registered via the deprecated oidc‑provider and mcp plugins. An attacker can register an OAuth client that uses a javascript: redirect_uri. The authorization server returns this unmodified in the consent response. If the consent page navigates the browser to that URI, the injected JavaScript executes in the context of the authorization‑server origin, exposing the victim’s session cookie and allowing an attacker to take over the victim’s account. The flaw is a stored XSS vulnerability (CWE‑79) that can lead to credential theft and account takeover.

Affected Systems

The affected product is better‑auth, the OAuth provider library. Versions prior to 1.6.13, as well as the pre‑release builds 1.7.0‑beta.0 through 1.7.0‑beta.3, contain the issue. The flaw originates from the relaxed validation in the deprecated oidc‑provider and mcp plugins. Any deployment that has enabled these plugins and has not updated to a fixed release is affected.

Risk and Exploitability

The CVSS score of 5.1 indicates medium severity. Exploit probability is unknown as EPSS data is not available, and the vulnerability is not listed in the CISA KEV catalog. The attack chain requires an attacker to register a malicious OAuth client and for a legitimate user to consent to the authorization request. Once the consent page redirects to the attacker‑controlled javascript: URI, the stored XSS is triggered. Because the flaw relies on registered client data and user interaction, the likelihood of mass exploitation is limited but the impact of a successful compromise is high, potentially allowing session hijacking and account takeover.

Generated by OpenCVE AI on August 2, 2026 at 02:59 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest better‑auth release (1.6.13 or newer) which includes validation for redirect_uri schemes.
  • If an upgrade is not possible immediately, remove or disable the deprecated oidc‑provider and mcp plugins to prevent registration of vulnerable clients.
  • Manually audit existing client registrations and delete any that contain a javascript: URI or other disallowed schemes.
  • Enforce redirect_uri scheme validation through configuration or middleware so that only https:, http:, or custom secure schemes are accepted.

Generated by OpenCVE AI on August 2, 2026 at 02:59 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 03 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sat, 01 Aug 2026 14:15:00 +0000

Type Values Removed Values Added
First Time appeared Better-auth better Auth
Vendors & Products Better-auth better Auth

Sat, 01 Aug 2026 12:45:00 +0000

Type Values Removed Values Added
Description 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.
Title better-auth before 1.6.13 Stored XSS via javascript redirect_uri
First Time appeared Better-auth
Better-auth better-auth\/oauth-provider
Weaknesses CWE-79
CPEs cpe:2.3:a:better-auth:better-auth\/oauth-provider:*:*:*:*:*:node.js:*:*
Vendors & Products Better-auth
Better-auth better-auth\/oauth-provider
References
Metrics cvssV3_1

{'score': 7.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': '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'}


Subscriptions

Better-auth Better-auth\/oauth-provider Better Auth
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-03T19:43:05.018Z

Reserved: 2026-07-29T13:07:47.015Z

Link: CVE-2026-67333

cve-icon Vulnrichment

Updated: 2026-08-03T19:43:00.622Z

cve-icon NVD

Status : Received

Published: 2026-08-01T13:17:04.123

Modified: 2026-08-03T20:17:27.323

Link: CVE-2026-67333

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T03:00:13Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')