Better Auth Has Stored XSS
Affects better-authSource GCVE Database
CVSS 7.7 High : upgrade to 1.6.13 soon.
Data as of 8 Jul 2026, 13:44 UTC
- 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:NWhat to do
Upgrade better-auth to 1.6.13; better-auth to 1.7.0-beta.4.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmbetter-auth | Affected
| Fixed in
|
| npmbetter-auth | Affected
| Fixed in
|
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
- github.com/better-auth/better-auth/security/advisories/GHSA-86j7-9j95-vpqj (opens in a new tab)
- github.com/better-auth/better-auth (opens in a new tab)
- github.com/better-auth/better-auth/releases/tag/v1.6.13 (opens in a new tab)
- github.com/better-auth/better-auth/releases/tag/v1.7.0-beta.4 (opens in a new tab)