Skip to main content
VulnerabilityPublished

Better Auth Has Stored XSS

Affects better-authSource GCVE Database

0

CVSS 7.7 High : upgrade to 1.6.13 soon.

Data as of 8 Jul 2026, 13:44 UTC

CVSS 3.1 base score
7.7High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.6.13, 1.7.0-beta.4
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

What to do

Upgrade better-auth to 1.6.13; better-auth to 1.7.0-beta.4.

Affected software

ProductAffectedFixed in
npmbetter-authAffected
  • <1.6.13
Fixed in
  • 1.6.13
npmbetter-authAffected
  • >=1.7.0-beta.0 <1.7.0-beta.4
Fixed in
  • 1.7.0-beta.4

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in better-auth version 1.6.13 (stable) and 1.7.0-beta.4 (pre-release) that adds scheme validation to redirect_uris, preventing javascript: URIs. Operators should upgrade to these versions to remediate the vulnerability. If upgrading is not immediately possible, developers should avoid navigating to the redirectURI value directly in client-side code or complete the consent flow with server-side redirects, which do not follow javascript: URLs. Using the newer @better-auth/oauth-provider package, which enforces safe URL schemes, also mitigates this issue.

Description

A stored cross-site scripting (XSS) vulnerability exists in the Better Auth authorization server when using the deprecated oidc-provider or mcp plugins in versions prior to 1.6.13. The vulnerability arises from improper validation of redirect_uri values during OAuth client registration, allowing an attacker to register a javascript: URI. When the consent page navigates to this URI, attacker-controlled JavaScript executes in the authorization server origin, risking session exposure and account takeover. The issue is fixed in better-auth versions 1.6.13 and later.

References

Community reviews

Loading reviews…