CVE-2025-71399
JSON

8.8high

Better Auth before 1.4.5 Path Normalization Bypass via rou3

Severity
8.8high CVSS:4.0 by VulnCheck
Exploit likelihood
0.31% (higher than 25% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-x732-6j76-qmhm

Description

Better Auth relies on better-call, which uses the rou3 router library. In affected versions of rou3, paths are normalized by removing empty segments, so /path, //path, and ///path resolve to the same route. In Better Auth versions prior to 1.4.5 (which bundles the fixed rou3), this can allow attackers to bypass disabledPaths configuration and path-based rate limits by submitting requests with extra slashes in the URL path. The issue does not apply in deployments where the proxy or platform normalizes URLs by collapsing multiple slashes.

Affected

Product or packageVersionsReported by
better-auth better-authbefore 1.4.5
Not affected: 1.4.5
CVE List
better-auth (npm)before 1.4.5GitHub Advisory Database

All scores

VulnCheck8.8high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
VulnCheck8.6high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H
GitHub8.6high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

Classification

CWE-20CWE-41CWE-400

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Better Auth relies on better-call, which uses the rou3 router library. In affected versions of rou3, paths are normalized by removing empty segments, so /path, //path, and ///path resolve to the same route. In Better Auth versions prior to 1.4.5 (which bundles the fixed rou3), this can allow attackers to bypass disabledPaths configuration and path-based rate limits by submitting requests with extra slashes in the URL path. The issue does not apply in deployments where the proxy or platform normalizes URLs by collapsing multiple slashes.

GitHub Advisory Database

Summary

An issue in the underlying router library rou3 can cause /path and //path to be treated as identical routes. If your environment does not normalize incoming URLs (e.g., by collapsing multiple slashes), this can allow bypasses of disabledPaths and path-based rate limits.

Details

Better Auth uses better-call, which internally relies on rou3 for routing. Affected versions of rou3 normalize paths by removing empty segments. As a result:

  • /sign-in/email
  • //sign-in/email
  • ///sign-in/email

…all resolve to the same route.

Some production setups automatically collapse multiple slashes. This includes:

In these environments and other configurations where //path reach Better Auth as /path, the issue does not apply.

Fix

Updating rou3 to the latest version resolves the issue:

Better Auth recommends:

  1. Upgrading to Better Auth v1.4.5 or later, which includes the updated rou3.
  2. Ensuring the proxy normalizes URLs.
  3. If project maintainers cannot upgrade yet, they can protect their app by normalizing url before it reaches better-auth handler. See example below:
const req = new Request(...) // this would be the actual request object
const url = new URL(req.url);
const normalizedPath = url.pathname.replace(/\/+/g, "/");

if (url.pathname !== normalizedPath) {
  url.pathname = normalizedPath;
  // Update the raw request pathname
  Object.defineProperty(req, "url", {
    value: url.toString(),
    writable: true,
    configurable: true,
  });
}

Impact

  • Bypass disabledPaths
  • Bypass path-based rate limits

The impact of bypassing disabled paths could vary based on a project's configuration.

NVD (es)

Better Auth depende de better-call, que utiliza la biblioteca de router rou3. En versiones afectadas de rou3, las rutas se normalizan eliminando segmentos vacíos, por lo que /path, //path y ///path se resuelven a la misma ruta. En versiones de Better Auth anteriores a la 1.4.5 (que incluye el rou3 corregido), esto puede permitir a los atacantes eludir la configuración de disabledPaths y los límites de tasa basados en rutas enviando solicitudes con barras adicionales en la ruta de la URL. El problema no se aplica en implementaciones donde el proxy o la plataforma normaliza las URL colapsando múltiples barras.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-71399 changed 2026-10-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-x732-6j76-qmhm changed 2026-08-03CC-BY-4.0
NVDCVE-2025-71399 changed 2026-10-08Public domain