Skip to main content

better-auth CVE-2025-71404

| EUVDEUVD-2025-210583 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-08-01 VulnCheck GHSA-ch2q-47vm-cxgf
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Attacker crafts malicious /api/auth/error URL
  2. Delivery
    Delivers link to victim via phishing or redirect
  3. Exploit
    Victim clicks link, browser requests the crafted URL
  4. Execution
    better-auth reflects unsanitized 'error' parameter as HTML
  5. Persist
    Injected JavaScript executes in victim's browser session
  6. Impact
    Attacker exfiltrates session cookies or credentials

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 that the target application is running better-auth version 0.0.2 through 1.1.15 and that the /api/auth/error route is reachable by a potential victim - this route is part of better-auth's default configuration and is not optional. The attacker must also coerce the victim into visiting a specially crafted URL (UI:A in CVSS 4.0), typically via phishing, QR code, or a redirect chain. No authentication is required from the attacker side (PR:N). The critical limiting factor is the mandatory user-interaction step: automated exploitation without victim participation is not possible for this reflected XSS class. Exploitation is further bounded by the victim's session and browser context - it does not affect other users or the server itself. Attacks against applications that sit behind SSO or that do not expose the /api/auth/error route publicly face a reduced but non-zero attack surface via authenticated users being redirected.

Impact

The CVSS 4.0 score of 5.1 (Medium) accurately captures the real-world risk profile: the UI:A metric is the decisive limiting factor, as exploitation is gated entirely on a victim clicking or being redirected to an attacker-controlled URL. Impact metrics VC:L/VI:L reflect the bounded but real consequences - session cookie theft, credential harvesting via fake login forms, and UI redressing are all plausible within the victim's browser session. The vulnerability is not listed in CISA KEV and no public exploit code has been confirmed, making opportunistic mass exploitation unlikely at present. EPSS data was not provided in the source intelligence. The absence of attack requirements (AT:N, AC:L) means that once a victim visits the URL, exploitation is reliable with no race condition or complex setup. The primary risk vector is targeted phishing using a legitimate-looking better-auth-hosted URL, which lends the attack inherent credibility. Overall, this is a genuine medium-priority finding: low barrier for a motivated attacker but limited blast radius without chaining to a follow-on attack such as session hijacking.

Exploit ScenarioDerived

An attacker crafts a URL such as https://target-app.com/api/auth/error?error=%3Cscript%3Ealert(document.cookie)%3C/script%3E and delivers it to a victim via phishing email or malicious link, exploiting the legitimacy of the target application's own domain to bypass suspicion. When the victim clicks the link, better-auth reflects the unsanitized payload into the HTML response and the victim's browser executes the injected JavaScript within the application's origin. No public proof-of-concept has been identified at time of analysis, but the vulnerability class is trivially reproducible given knowledge of the affected endpoint.

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

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

Alert me

AnalysisAIv1 – Aug 01, 2026

Reflected XSS in better-auth's /api/auth/error endpoint enables arbitrary JavaScript execution in a victim's browser when a user visits an attacker-crafted URL containing a malicious 'error' query parameter that is reflected as unsanitized HTML. All npm releases of better-auth from version 0.0.2 up to (but not including) 1.1.16 are affected, spanning virtually the entire release history of the library. No public exploit code has been identified at time of analysis and the vulnerability is not listed in CISA KEV; however, the attack surface is inherently internet-accessible and requires only social engineering to trigger.

RemediationAI

Upgrade the better-auth npm package to version 1.1.16, which is the vendor-confirmed fix version per both GHSA-9x4v-xfq5-m8x5 and ENISA EUVD-2025-210583. The patch is available at https://github.com/better-auth/better-auth/commit/7ae340e2eddad641b7e43d24d37c58a66ce9ddcf. If an immediate upgrade is not feasible, a compensating control is to place a Web Application Firewall rule or reverse proxy filter that strips or encodes angle brackets and script-injection sequences from the 'error' query parameter on requests to /api/auth/error; note this trades off completeness of error messaging and may require ongoing maintenance as bypass techniques evolve. Blocking direct external access to the /api/auth/error path entirely is a more robust workaround where the authentication error page is not required for external users, at the cost of degraded error UX.

Affected VersionsENISA

better-auth 0 <1.1.16

Affected Packages

npm better-auth fix: 1.1.16

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 an npm authentication framework (cpe:2.3:a:better-auth:better-auth:*:*:*:*:*:*:*:*) that exposes a built-in /api/auth/error HTTP route for surfacing authentication errors to end users. Per GHSA-9x4v-xfq5-m8x5, the vulnerable code at packages/better-auth/src/api/routes/error.ts line 81 interpolates the raw value of the 'error' URL query parameter directly into the HTML response without encoding or sanitization, satisfying CWE-79 (Improper Neutralization of Input During Web Page Generation). Because the parameter is server-reflected rather than stored, the payload is not persisted and must be delivered fresh with each victim request - the classic reflected XSS pattern. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A) confirms that no special network position or attack prerequisite is needed beyond inducing a user to follow a link.

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:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
vuln.today AI 6.1 MEDIUM

Network-accessible with no privileges needed; scope changes as injected JS executes in victim browser context; user interaction required to click the crafted link.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

better-auth versions after v0.0.2 and before 1.1.16 contain a reflected cross-site scripting (XSS) vulnerability on the /api/auth/error page, where the value of the 'error' URL parameter is reflected as HTML without proper neutralization. An attacker who coerces a user into visiting a specially-crafted URL can execute arbitrary JavaScript in the context of the user's browser. The issue is fixed in version 1.1.16.

Threat Intelligence Overview

EPSS Score
0.4%
Top 67% exploitable
Prevalence
Medium
growing npm authentication library, not yet pervasive
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment 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.4%
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