Description
Better Auth is an authentication and authorization library for TypeScript. Prior to 1.4.17 and 1.5.0-beta.9, Better Auth's HTTP rate limiter keyed each request by the exact textual IP address it received in x-forwarded-for (or the configured IP-bearing header). IPv6 clients controlling a typical /64 allocation could rotate through 2^64 distinct source addresses without exhausting the per-address counter, defeating rate limiting on /sign-in/email, /sign-up/email, /forget-password, and every other path the limiter protects. The same bug allowed a single client to vary the textual encoding of one IPv6 address (uppercase, compression, IPv4-mapped, hex-encoded IPv4-in-IPv6) and produce multiple distinct keys. This vulnerability is fixed in 1.4.17 and 1.5.0-beta.9.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| better-auth | better-auth | < 1.4.17, >= 1.5.0-beta.1, < 1.5.0-beta.9 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | better-auth | < 1.4.17 | 1.4.17 | GHSA-p6v2-xcpg-h6xw |
| npm | better-auth | >= 1.5.0-beta.1, < 1.5.0-beta.9 | 1.5.0-beta.9 | GHSA-p6v2-xcpg-h6xw |
References
- https://github.com/better-auth/better-auth/security/advisories/GHSA-p6v2-xcpg-h6xw
- https://github.com/better-auth/better-auth/pull/7470
- https://github.com/better-auth/better-auth/pull/7509
- https://github.com/better-auth/better-auth/commit/43e719bcc0c223c7079fa0c611a9cf7ea1188254
- https://github.com/better-auth/better-auth/commit/57af0f7b910dcf7b1a5c0615d10b9bd56bb69bef