Better Auth allows bypassing the trustedOrigins Protection which leads to ATO
Summary
A bypass was discovered in the trustedOrigins validation logic—affecting both absolute URL entries and wildcard domain patterns. This flaw allows an attacker to construct a malicious callbackURL that passes origin checks and triggers an open redirect.
Because redirect endpoints include sensitive tokens (such as password-reset tokens), this vulnerability can enable one-click account takeover if a victim clicks a crafted link.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | better-auth | < 1.1.21 | 1.1.21 |
References
- https://github.com/better-auth/better-auth/security/advisories/GHSA-vp58-j275-797x
- https://github.com/better-auth/better-auth/commit/b381cac7aafd6aa53ef78b6ab771ebfa24643c80
- https://github.com/better-auth/better-auth
- https://github.com/better-auth/better-auth/blob/ddebd0358d74376ea64541512d0167dd4377f182/packages/better-auth/src/api/middlewares/origin-check.ts#L53
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N- Weakness (CWE)
CWE-601- Platform
- npm
- Package
better-auth- Disclosed
- 24.02.2025
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-vp58-j275-797x - CC BY 4.0
Vulnerability history: better-auth
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 22
- First → latest
- 12.2024 07.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 2
- High 14
- Medium 3
- Low 3
Disclosures per year
- 2024: 1
- 2025: 8
- 2026: 13
-
Better Auth allows bypassing the trustedOrigins Protection which leads to ATO this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.