Vulnerability DatabaseGHSA-569q-mpph-wgww

GHSA-569q-mpph-wgww
Better Auth vulnerability analysis and mitigation

Summary

Affected versions of Better Auth allow an external request to configure baseURL when it isn’t defined through any other means. This can be abused to poison the router’s base path, causing all routes to return 404 for all users. This issue is only exploitable when baseURL is not explicitly configured (e.g., BETTER_AUTH_URL is missing) and the attacker is able to make the very first request to the server after startup. In properly configured environments or typical managed hosting platforms, this fallback behavior cannot be reached.

Details

A combination of X-Forwarded-Host and X-Forwarded-Proto is implicitly trusted. This allows the first request to configure baseURL whenever it is not explicitly configured. Here's the code that reads the headers: headers Here's the call to getBaseURL(), the result is assigned to ctx.baseURL. write Here's the router receiving the poisoned basePath: router X-Forwarded-Host and X-Forwarded-Proto can be used to modify the pathname of a parsed URL object which forms baseURL. basePath is then derived from the pathname of baseURL. Once the router basePath is poisoned it fails to match & route incoming requests.

Repro

Start a better-auth server with no baseURL configuration. Send the following request as the first request to the server:

curl -i --location 'https://example.com/api/auth/ok' \
--header 'X-Forwarded-Proto: some:' \
--header 'X-Forwarded-Host: junk'

The better-auth API check endpoint returns 404. Now send a regular request without the X-Forwarded-Proto and X-Forwarded-Host headers.

curl -i --location 'https://example.com/api/auth/ok'

The better-auth API check endpoint still returns 404. Example result attack We have modified the basePath for the router until the server is restarted. An attacker can repeatedly send these attack requests aiming to persistently exploit the vulnerability.


SourceNVD

Related Better Auth vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-61928CRITICAL9.3
  • Better AuthBetter Auth
  • better-auth
NoYesOct 09, 2025
GHSA-x732-6j76-qmhmHIGH8.6
  • Better AuthBetter Auth
  • better-auth
NoYesDec 16, 2025
GHSA-99h5-pjcv-gr6vHIGH8.6
  • Better AuthBetter Auth
  • better-auth
NoYesOct 09, 2025
GHSA-569q-mpph-wgwwLOW2.9
  • Better AuthBetter Auth
  • better-auth
NoYesDec 01, 2025
GHSA-wmjr-v86c-m9jjLOW2
  • Better AuthBetter Auth
  • better-auth
NoYesNov 26, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management