VDB
KO
MEDIUM

GHSA-9x4v-xfq5-m8x5

Better Auth URL parameter HTML Injection (Reflected Cross-Site scripting)

Quick fix

GHSA-9x4v-xfq5-m8x5 — better-auth: upgrade to the fixed version with the command below.

npm install better-auth@1.1.16

Details

### 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.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm / better-auth
Introduced in: 0.0.2 Fixed in: 1.1.16
Fix npm install better-auth@1.1.16

References