🛡️ GHSA-hq75-xg7r-rx6c — better-call
Description
Better Call routing bug can lead to Cache Deception
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.
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality high, integrity none, availability none.
Weakness class
GHSA-hq75-xg7r-rx6c is classified as 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.
Affected software
GHSA-hq75-xg7r-rx6c is recorded against 1 package.
- better-call
Timeline and source
Published on 11 July 2025. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
Details
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 Packages
| Software | From version | Fixed in |
|---|---|---|
| better-call | — | — |
References
Free Vulnerability Check
Is your site affected by GHSA-hq75-xg7r-rx6c?
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-hq75-xg7r-rx6c and other known CVE records.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.