CVE-2025-27143: Better auth Beter Auth Has An Open Vulnerability
MODERATECVE-2025-27143 is a MODERATE beter auth has an open vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Better auth libraries in the npm ecosystem. The issue involves beter auth has an open redirect via scheme-less callback parameter. Remediation is available by upgrading affected packages to version 1.1.20.
CVE-2025-27143 at a Glance
How to Fix CVE-2025-27143
To remediate this vulnerability, upgrade all affected Better auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install better-auth@1.1.20
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls better-auth
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-27143, inspect your project dependencies using npm:
npm ls better-auth
Analyze the terminal output to locate any version of Better auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.20), your application is affected.
Note: The npm ls better-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Better auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-27143 Affected Better auth Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
better-auth
|
npm |
< 1.1.20
|
1.1.20
|
References
Frequently Asked Questions
What is CVE-2025-27143?
Which Better auth versions are affected?
What version fixes CVE-2025-27143?
Is better-auth affected?
What CWE is associated with CVE-2025-27143?
How can I check npm dependencies for CVE-2025-27143?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hjpm-7mrm-26w8",
"modified" : "2025-02-25T18:00:22Z",
"published" : "2025-02-24T18:27:55Z",
"aliases" : [ "CVE-2025-27143" ],
"summary" : "Beter Auth has an Open Redirect via Scheme-Less Callback Parameter",
"details" : "### Summary\nThe application is vulnerable to an open redirect due to improper validation of the callbackURL parameter in the email verification endpoint and any other endpoint that accepts callback url. While the server blocks fully qualified URLs (e.g., https://evil.com), it incorrectly allows scheme-less URLs (e.g., //malicious-site.com). This results in the browser interpreting the URL as https://malicious-site.com, leading to unintended redirection.\n\nbypass for : https://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723\n\n### Affected Versions\nAll versions prior to 1.1.19\n\n### Details\nThe application’s email verification endpoint (/auth/verify-email) accepts a callbackURL parameter intended to redirect users after successful email verification. While the server correctly blocks fully qualified external URLs (e.g., https://evil.com), it improperly allows scheme-less URLs (e.g., //malicious-site.com). This issue occurs because browsers interpret //malicious-site.com as https://malicious-site.com, leading to an open redirect vulnerability.\n\nAn attacker can exploit this flaw by crafting a malicious verification link and tricking users into clicking it. Upon successful email verification, the user will be automatically redirected to the attacker's website, which can be used for phishing, malware distribution, or stealing sensitive authentication tokens.\n\n### Impact\nPhishing & Credential Theft – Attackers can redirect users to a fake login page, tricking them into entering sensitive credentials, which can then be stolen.\n\nSession Hijacking & Token Theft – If used in OAuth flows, an attacker could redirect authentication tokens to their own domain, leading to account takeover.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "better-auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.20"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-hjpm-7mrm-26w8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27143"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/commit/24659aefc35a536b95ea4e5347e52c8803910153"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/commit/b381cac7aafd6aa53ef78b6ab771ebfa24643c80"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/better-auth/better-auth"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/releases/tag/v1.1.21"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-02-24T18:27:55Z",
"nvd_published_at" : "2025-02-24T23:15:11Z"
}
}