Better Auth HTTP Rate Limiting Vulnerability Allows Bypass via IPv6 Address Rotation

Vulnerability

A vulnerability in Better Auth's authentication and authorization library for TypeScript, specifically in versions prior to 1.4.17 and 1.5.0-beta.9, allows for bypassing HTTP rate limits on authentication-related endpoints. The issue arises because the rate limiter keys requests based on the exact IP address received in the 'x-forwarded-for' header. This approach is vulnerable to exploitation by IPv6 clients, which can rotate through a vast number of addresses without exhausting the rate limit counter. Additionally, the vulnerability allows for manipulation of the IP address representation, creating further discrepancies in rate limit enforcement.

Impact

Exploitation of this vulnerability removes rate limits on authentication attempts via email, potentially leading to credential stuffing and brute-force attacks. It also allows for faster account enumeration and can amplify password reset and email verification processes.

Reproduction

The vulnerability can be reproduced by sending requests to the affected authentication endpoints while varying the IPv6 address representations. This can be done by using different encodings of the same IPv6 address or by rotating through multiple addresses within a /64 subnet allocation.

Remediation

Users can upgrade to Better Auth versions 1.4.17 or 1.5.0-beta.9, both of which include the necessary fix. If an upgrade is not possible, users on version 1.4.16 can set 'advanced.ipAddress.ipv6Subnet' to 64 in their configuration to restore the intended rate limit behavior. For versions prior to 1.4.16, the recommendation is to adjust the rate limit settings on the CDN, WAF, or load balancer to apply a /64 prefix limit, or to manually tighten the rate limit windows for the sign-in, sign-up, and password reset endpoints.

Added: May 28, 2026, 10:25 PM
Updated: May 28, 2026, 10:25 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
0.6
exploitability
5.7
remediation
8.3
relevance
9.2
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.