GHSA-x732-6j76-qmhm: Better auth Better Auth's Rou3 Dependency Has Vulnerability

HIGH
CVSS 8.6
CWE-41 CWE-400
Published
Advisory Summary

GHSA-x732-6j76-qmhm is a HIGH (CVSS 8.6) better auth's rou3 dependency has vulnerability (CWE-41: Improper Resolution of Path Equivalence) affecting Better auth libraries in the npm ecosystem. The issue involves better auth's rou3 dependency has double-slash path normalization which can bypass disabledpaths config and rate limits. Remediation is available by upgrading affected packages to version 1.4.5.

GHSA-x732-6j76-qmhm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-x732-6j76-qmhm
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-41: Improper Resolution of Path Equivalence
Affected Product Better auth
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability High (A:H)

How to Fix GHSA-x732-6j76-qmhm

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.

better-auth fixed: 1.4.5
npm install better-auth@1.4.5
Verify Direct and Transitive Dependencies

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-x732-6j76-qmhm, 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.4.5), 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-41: Improper Resolution of Path Equivalence, where the product is vulnerable to file system contents disclosure through path equivalence. path equivalence involves the use of special characters in file and directory names. the associated manipulations are intended to generate multiple names for the same object. 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

## 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: * Vercel with Nextjs (default) * Cloudflare - when normalize to urls origin is enabled (https://developers.cloudflare.com/rules/normalization/settings/#normalize-urls-to-origin) 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-call previously depended on `"rou3": "^0.5.1"` * The fix was introduced after that version (commit: [https://github.com/h3js/rou3/commit/f60b43fa648399534507c9ac7db36d705b8874c3](https://github.com/h3js/rou3/commit/f60b43fa648399534507c9ac7db36d705b8874c3)) 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: ```ts 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.

GHSA-x732-6j76-qmhm Affected Better auth Versions

1 component(s)
Fixed Versions:
1.4.5
Product / Package Ecosystem Affected Versions Fixed Version
better-auth
npm
< 1.4.5
1.4.5

References

Frequently Asked Questions

What is GHSA-x732-6j76-qmhm?
GHSA-x732-6j76-qmhm is a security vulnerability in Better auth involving Better Auth's rou3 Dependency has Double-Slash Path Normalization which can Bypass disabledPaths Config and Rate Limits under CWE-41: Improper Resolution of Path Equivalence.
Which Better auth versions are affected?
Affected versions include releases prior to 1.4.5 across affected packages: better-auth.
What version fixes GHSA-x732-6j76-qmhm?
Upgrading to 1.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is better-auth affected?
Yes, better-auth is affected in releases prior to 1.4.5. Upgrade your dependency to 1.4.5 or later.
What is the CVSS score of GHSA-x732-6j76-qmhm?
GHSA-x732-6j76-qmhm has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H.
What CWE is associated with GHSA-x732-6j76-qmhm?
GHSA-x732-6j76-qmhm is classified under CWE-41: Improper Resolution of Path Equivalence (The product is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.).
How can I check npm dependencies for GHSA-x732-6j76-qmhm?
Run the dependency tree command: 'npm ls better-auth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x732-6j76-qmhm",
  "modified" : "2025-12-16T21:22:45Z",
  "published" : "2025-12-16T21:22:45Z",
  "aliases" : [ ],
  "summary" : "Better Auth's rou3 Dependency has Double-Slash Path Normalization which can Bypass disabledPaths Config and Rate Limits",
  "details" : "## Summary\n\nAn 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.\n\n## Details\n\nBetter Auth uses **better-call**, which internally relies on **rou3** for routing. Affected versions of rou3 normalize paths by removing empty segments. As a result:\n\n* `/sign-in/email`\n* `//sign-in/email`\n* `///sign-in/email`\n\n…all resolve to the same route.\n\nSome production setups *automatically* collapse multiple slashes. This includes:\n\n* Vercel with Nextjs (default)\n* Cloudflare - when normalize to urls origin is enabled (https://developers.cloudflare.com/rules/normalization/settings/#normalize-urls-to-origin)\n\nIn these environments and other configurations where `//path` reach Better Auth as `/path`, the issue does not apply.\n\n## Fix\n\nUpdating rou3 to the latest version resolves the issue:\n\n* better-call previously depended on `\"rou3\": \"^0.5.1\"`\n* The fix was introduced after that version\n  (commit: [https://github.com/h3js/rou3/commit/f60b43fa648399534507c9ac7db36d705b8874c3](https://github.com/h3js/rou3/commit/f60b43fa648399534507c9ac7db36d705b8874c3))\n\nBetter Auth recommends:\n\n1. **Upgrading to Better Auth v1.4.5 or later**, which includes the updated rou3.\n2. Ensuring the proxy normalizes URLs.\n3. If project maintainers cannot upgrade yet, they can protect their app by normalizing url before it reaches better-auth handler. See example below:\n```ts\nconst req = new Request(...) // this would be the actual request object\nconst url = new URL(req.url);\nconst normalizedPath = url.pathname.replace(/\\/+/g, \"/\");\n\nif (url.pathname !== normalizedPath) {\n  url.pathname = normalizedPath;\n  // Update the raw request pathname\n  Object.defineProperty(req, \"url\", {\n    value: url.toString(),\n    writable: true,\n    configurable: true,\n  });\n}\n```\n\n## Impact\n\n* Bypass `disabledPaths`\n* Bypass path-based rate limits\n\nThe impact of bypassing disabled paths could vary based on a project's configuration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "better-auth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-x732-6j76-qmhm"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/better-auth/better-auth"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-41" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-16T21:22:45Z",
    "nvd_published_at" : null
  }
}