GHSA-hq75-xg7r-rx6c: Better call Better Call Routing Bug Can Vulnerability

MODERATE
CWE-525
Published
Advisory Summary

GHSA-hq75-xg7r-rx6c is a MODERATE better call routing bug can vulnerability (CWE-525: Use of Web Browser Cache Containing Sensitive Information) affecting Better call libraries in the npm ecosystem. The issue involves better call routing bug can lead to cache deception. Remediation is available by upgrading affected packages to version 1.0.12.

GHSA-hq75-xg7r-rx6c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hq75-xg7r-rx6c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-525: Use of Web Browser Cache Containing Sensitive Information
Affected Product Better call
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-hq75-xg7r-rx6c

To remediate this vulnerability, upgrade all affected Better call 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-call fixed: 1.0.12
npm install better-call@1.0.12
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-call

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-hq75-xg7r-rx6c, inspect your project dependencies using npm:

npm ls better-call

Analyze the terminal output to locate any version of Better call in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.12), your application is affected.

Note: The npm ls better-call 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-525: Use of Web Browser Cache Containing Sensitive Information, where the web application does not use an appropriate caching policy that specifies the extent to which each web page and associated form fields should be cached. In Better call, 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 Using a CDN that caches (`/**/*.png`, `/**/*.json`, `/**/*.css`, etc...) requests, a cache deception can emerge. This could lead to unauthorized access to user sessions and personal data when cached responses are served to other users. ### Details The vulnerability occurs in the request processing logic where path sanitization is insufficient. The library splits the path using `config.basePath` but doesn't properly validate the remaining path components. This allows specially crafted requests that appear to be static assets (like `/api/auth/get-session/api/auth/image.png` assuming `config.basePath`=`/api/auth`) to bypass typical CDN cache exclusion rules while actually returning sensitive data. The problematic code [here](https://github.com/Bekacru/better-call/blob/8b6f13e24fad7f4666a582601517bb3232d4f4af/src/router.ts#L124): ```js const processRequest = async (request: Request) => { const url = new URL(request.url); const path = config?.basePath ? url.pathname.split(config.basePath)[1] : url.pathname; ``` Since this library is largely coupled with `better-auth`, it becomes more clear why this can be dangerous with an example request: <img width="800" alt="image" src="https://github.com/user-attachments/assets/2ab7c4dd-0700-4f59-863f-79f2b5edbb37" /> ### Impact This is a cache deception vulnerability affecting `better-call` users with CDN caching enabled. which can expose sensitive data.

GHSA-hq75-xg7r-rx6c Affected Better call Versions

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

References

Frequently Asked Questions

What is GHSA-hq75-xg7r-rx6c?
GHSA-hq75-xg7r-rx6c is a security vulnerability in Better call involving Better Call routing bug can lead to Cache Deception under CWE-525: Use of Web Browser Cache Containing Sensitive Information.
Which Better call versions are affected?
Affected versions include releases prior to 1.0.12 across affected packages: better-call.
What version fixes GHSA-hq75-xg7r-rx6c?
Upgrading to 1.0.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is better-call affected?
Yes, better-call is affected in releases prior to 1.0.12. Upgrade your dependency to 1.0.12 or later.
What CWE is associated with GHSA-hq75-xg7r-rx6c?
GHSA-hq75-xg7r-rx6c is classified under CWE-525: Use of Web Browser Cache Containing Sensitive Information (The web application does not use an appropriate caching policy that specifies the extent to which each web page and associated form fields should be cached.).
How can I check npm dependencies for GHSA-hq75-xg7r-rx6c?
Run the dependency tree command: 'npm ls better-call'. 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-hq75-xg7r-rx6c",
  "modified" : "2025-07-11T17:09:53Z",
  "published" : "2025-07-11T17:09:53Z",
  "aliases" : [ ],
  "summary" : "Better Call routing bug can lead to Cache Deception",
  "details" : "### Summary\n\nUsing a CDN that caches (`/**/*.png`, `/**/*.json`, `/**/*.css`, etc...) requests, a cache deception can emerge. This could lead to unauthorized access to user sessions and personal data when cached responses are served to other users.\n\n### Details\n\nThe vulnerability occurs in the request processing logic where path sanitization is insufficient. The library splits the path using `config.basePath` but doesn't properly validate the remaining path components. This allows specially crafted requests that appear to be static assets (like `/api/auth/get-session/api/auth/image.png` assuming `config.basePath`=`/api/auth`) to bypass typical CDN cache exclusion rules while actually returning sensitive data.\n\nThe problematic code [here](https://github.com/Bekacru/better-call/blob/8b6f13e24fad7f4666a582601517bb3232d4f4af/src/router.ts#L124):\n```js\n\tconst processRequest = async (request: Request) => {\n\t\tconst url = new URL(request.url);\n\t\tconst path = config?.basePath ? url.pathname.split(config.basePath)[1] : url.pathname;\n```\n\nSince this library is largely coupled with `better-auth`, it becomes more clear why this can be dangerous with an example request:\n\n<img width=\"800\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2ab7c4dd-0700-4f59-863f-79f2b5edbb37\" />\n\n### Impact\n\nThis is a cache deception vulnerability affecting `better-call` users with CDN caching enabled. which can expose sensitive data.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "better-call"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Bekacru/better-call/security/advisories/GHSA-hq75-xg7r-rx6c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Bekacru/better-call/commit/7c7d31b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Bekacru/better-call"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-525" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-11T17:09:53Z",
    "nvd_published_at" : null
  }
}