CVE-2025-27143
JavaScript vulnerability analysis and mitigation

Overview

Better Auth, an authentication and authorization library for TypeScript, was found vulnerable to an open redirect attack prior to version 1.1.21. The vulnerability exists in the email verification endpoint and any other endpoint that accepts callback URLs. The issue was discovered on February 24, 2025, and is tracked as CVE-2025-27143. This vulnerability is a bypass of a previous fix for CVE-2024-56734 (GitHub Advisory).

Technical details

The vulnerability stems from improper validation of the callbackURL parameter. While the server blocks fully qualified URLs, it incorrectly allows scheme-less URLs (e.g., //malicious-site.com). When such URLs are processed, browsers interpret them as fully qualified URLs (e.g., https://malicious-site.com), leading to unintended redirection. The vulnerability has been assigned a CVSS v3.1 Base Score of 6.1 (MEDIUM) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N (NVD).

Impact

The vulnerability can be exploited for phishing attacks, malware distribution, or stealing sensitive authentication tokens. When users click on a crafted malicious verification link, they can be automatically redirected to an attacker's website. This could lead to credential theft through fake login pages or potential session hijacking if used in OAuth flows (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in Better Auth version 1.1.21. The fix includes improved validation of callback URLs using a more strict regex pattern that prevents scheme-less URLs and other potentially malicious patterns. The patch can be found in commits 24659ae and b381cac (GitHub Patch 1, GitHub Patch 2).

Additional resources


SourceThis report was generated using AI

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