GHSA-9x4v-xfq5-m8x5: Better Auth URL parameter HTML Injection (Reflected Cross-Site scripting)
Summary The better-auth /api/auth/error page was vulnerable to HTML injection, resulting in a reflected cross-site scripting (XSS) vulnerability. Details The value of error URL parameter was reflected as HTML on the error page: https://github.com/better-auth/better-auth/blob/05ada0b79dbcac93cc04ceb79b23ca598d07830c/packages/better-auth/src/api/routes/error.ts#L81 Impact An attacker who exploited this vulnerability…
Published Feb 5, 2025 · Updated Dec 9, 2025
Affected packages
better-auth
- Ecosystem
- npm
- Affected
- >= 0.0.2, < 1.1.16
- Fixed in
- 1.1.16
- Check
npm ls better-auth
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The better-auth /api/auth/error page was vulnerable to HTML injection, resulting in a reflected cross-site scripting (XSS) vulnerability.
Details
The value of error URL parameter was reflected as HTML on the error page: https://github.com/better-auth/better-auth/blob/05ada0b79dbcac93cc04ceb79b23ca598d07830c/packages/better-auth/src/api/routes/error.ts#L81
Impact
An attacker who exploited this vulnerability by coercing a user to visit a specially-crafted URL could execute arbitrary JavaScript in the context of the user's browser.
Credited to Eriner.
References
- https://github.com/better-auth/better-auth/security/advisories/GHSA-9x4v-xfq5-m8x5
- https://github.com/better-auth/better-auth/commit/7ae340e2eddad641b7e43d24d37c58a66ce9ddcf
- https://github.com/better-auth/better-auth/blob/05ada0b79dbcac93cc04ceb79b23ca598d07830c/packages/better-auth/src/api/routes/error.ts#L81
- https://github.com/advisories/GHSA-9x4v-xfq5-m8x5
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-114607
better-auth: OAuth state can be used as a Magic Link to sign in as another user
critical9.1Oct 27, 2026GHSA-44jh-23m7-hpcf
@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL
low3.7Oct 27, 2026GHSA-q84f-53jg-9ppm
better-auth: Device login approval does not show the requesting client or permissions
high8.1Oct 27, 2026GHSA-r4xp-prcw-77qf
better-auth: OAuth Proxy lets an attacker sign in as another user
high7.4Oct 27, 2026GHSA-qq9h-g4jm-xgf3
Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in
high8.3Jul 24, 2026CVE-2026-53512
Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
critical9.1Jul 7, 2026
