{"answers":{"affected":"2 open source packages ship an affected version, including better-call.","exploited":"There is no known exploitation of GHSA-hq75-xg7r-rx6c in the wild and no public exploit code.","fix":"Upgrade better-call to 1.0.12 or later.","what":"GHSA-hq75-xg7r-rx6c is a vulnerability in better-call, published on 11 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-hq75-xg7r-rx6c and fix it if it is affected.\n\nWhat it is: GHSA-hq75-xg7r-rx6c is a vulnerability in better-call, published on 11 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-hq75-xg7r-rx6c in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- better-call (npm): affected all versions; fixed in 1.0.12\n- better-call (npm): affected all versions; fixed in 1.0.12\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-hq75-xg7r-rx6c/ (Markdown: https://insights.sbomify.com/GHSA-hq75-xg7r-rx6c/index.md)","id":"GHSA-hq75-xg7r-rx6c","markdown":"https://insights.sbomify.com/GHSA-hq75-xg7r-rx6c/index.md","name":"GHSA-hq75-xg7r-rx6c","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"JavaScript routing library","requires_auth":"none","summary":"Insufficient path sanitization allows cache deception via CDN, exposing sensitive user session data to unauthorized users.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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) =\u003e {\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\u003cimg width=\"800\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2ab7c4dd-0700-4f59-863f-79f2b5edbb37\" /\u003e\n\n### Impact\n\nThis is a cache deception vulnerability affecting `better-call` users with CDN caching enabled. which can expose sensitive data.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Better Call routing bug can lead to Cache Deception","id":"GHSA-hq75-xg7r-rx6c","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"information_disclosure","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["1.0.12"],"introduced":["0"],"last_affected":[],"package":"better-call","purl":null,"source":"GHSA-hq75-xg7r-rx6c"},{"ecosystem":"npm","fixed":["1.0.12"],"introduced":["0"],"last_affected":[],"package":"better-call","purl":"pkg:npm/better-call","source":"GHSA-hq75-xg7r-rx6c"}],"products":null,"published":"2025-07-11","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Insufficient path sanitization allows cache deception via CDN, exposing sensitive user session data to unauthorized users.","url":"https://insights.sbomify.com/GHSA-hq75-xg7r-rx6c/"}