GHSA-9x4v-xfq5-m8x5: Better auth Cross-Site Scripting Vulnerability
MODERATEGHSA-9x4v-xfq5-m8x5 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Better auth libraries in the npm ecosystem. The issue involves better auth url parameter html injection (reflected cross-site scripting). Remediation is available by upgrading affected packages to version 1.1.16.
GHSA-9x4v-xfq5-m8x5 at a Glance
How to Fix GHSA-9x4v-xfq5-m8x5
To remediate this vulnerability, upgrade all affected Better auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install better-auth@1.1.16
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls better-auth
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-9x4v-xfq5-m8x5, inspect your project dependencies using npm:
npm ls better-auth
Analyze the terminal output to locate any version of Better auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.16), your application is affected.
Note: The npm ls better-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Better auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-9x4v-xfq5-m8x5 Affected Better auth Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
better-auth
|
npm |
≥ 0.0.2
< 1.1.16
|
1.1.16
|
References
Frequently Asked Questions
What is GHSA-9x4v-xfq5-m8x5?
Which Better auth versions are affected?
What version fixes GHSA-9x4v-xfq5-m8x5?
Is better-auth affected?
What CWE is associated with GHSA-9x4v-xfq5-m8x5?
How can I check npm dependencies for GHSA-9x4v-xfq5-m8x5?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9x4v-xfq5-m8x5",
"modified" : "2025-12-09T16:26:23Z",
"published" : "2025-02-05T21:49:39Z",
"aliases" : [ ],
"summary" : "Better Auth URL parameter HTML Injection (Reflected Cross-Site scripting)",
"details" : "### Summary\nThe better-auth `/api/auth/error` page was vulnerable to HTML injection, resulting in a reflected cross-site scripting (XSS) vulnerability.\n\n### Details\nThe 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\n\n### Impact\nAn 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "better-auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.0.2"
}, {
"fixed" : "1.1.16"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-9x4v-xfq5-m8x5"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/commit/7ae340e2eddad641b7e43d24d37c58a66ce9ddcf"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/better-auth/better-auth"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/blob/05ada0b79dbcac93cc04ceb79b23ca598d07830c/packages/better-auth/src/api/routes/error.ts#L81"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-05T21:49:39Z",
"nvd_published_at" : null
}
}