Open Redirect Vulnerability in Better Auth Verify Email Endpoint

Published Date: January 1, 2025

Package Affected Versions Patched Versions Severity
📦 better-auth (npm) < 1.1.6 1.1.6 High

Description

Better Auth versions below v1.1.6 have an open redirect vulnerability in the verify email endpoint. Attackers can exploit this flaw to redirect users to malicious websites via crafted email verification links.

Attackers can exploit this to:

  • Phish users: Fake login pages trick users into revealing sensitive data.

  • Damage trust: Applications using Better Auth may face reputational harm.


The issue lies in the callbackURL parameter of the verify email endpoint. Unlike other endpoints, this one skips proper domain validation during JWT verification. The vulnerability stems from a missing origin check for GET requests.

Exploit Example:

https://example.com/auth/verify-email?token=abcd1234&callbackURL=https://malicious-site.com


Here, the callbackURL parameter redirects users to an attacker-controlled domain.

Patches & Workarounds

Upgrade to Better Auth v1.1.6 or later.
This version enforces strict domain validation for callbackURL on the /verify-email path and other GET endpoints.




đź©ą Workaround (Temporary Fix)


If upgrading isn’t possible, add a pre-check hook to validate callbackURL:
const auth = betterAuth({
hooks: {
before: (ctx) => {
if (ctx.path === “/verify-email”) {
const callbackURL = ctx.query.callbackURL;
if (!callbackURL.startsWith(‘https://trusted-domain.com’)) {
throw new Error(‘Untrusted callback URL’);
}
}
}
}
});

 

This approach checks if the callbackURL points to a trusted domain before proceeding.

References

https://nvd.nist.gov/vuln/detail/CVE-2024-56734
Share this:
  • Cybersecurity Risks of U.S. Trade Tariffs: Impact on Supply Chains in Canada, Mexico & the EU

    In early 2025, the U.S. government announced new tariffs aimed at Canada, Mexico, and potentially the European Union. While the tariffs on Canada and Mexico are temporarily on hold, businesses are already adjusting supply chains to prepare for the financial impact. Trade policies like these cause ripple effects across industries, and cybersecurity often takes a…

  • Dark Web & Small Businesses: How Hackers Sell Your Data

    Many small business owners assume that cyberattacks only target large corporations. They imagine hackers as shadowy figures breaching high-security networks of multinational companies. The reality is much bleaker: small businesses are prime targets because they often lack strong cybersecurity defenses. Worse, once stolen, their data often ends up for sale on the dark web.

  • Top 10 Viruses and Malware Wreaking Havoc in January 2025

    Learn how to identify and defend against the latest cybersecurity threats like Banshee, Clop Ransomware, and AI-powered attacks. Stay one step ahead of hackers with this detailed guide.

  • Should You Invest in DIY AI Assistants?

    With AI technologies advancing rapidly, there’s growing interest in building personal assistants at home. Today, big names like Alexa and Google Home dominate the market, but their capabilities remain limited by their current integrations. Meanwhile, ChatGPT and Google’s Gemini have revolutionized conversational AI, although they lack standalone devices or wake-word functionality. These limitations won’t last…

  • How Spilled Coffee Saved a Company

    Small businesses face countless threats—phishing attacks, ransomware, budget constraints, and, occasionally, over-caffeinated interns. This is the story of Taxify Associates, a mid-sized accounting firm that narrowly avoided financial ruin thanks to a spilled cup of coffee, a frayed carpet, and one overworked IT manager.

  • How Cybercriminals Bypass Apple iMessage Security Protections

    Cybercriminals have found a simple yet effective way to bypass Apple’s phishing protections built into iMessage. This exploit enables them to trick users into activating dangerous phishing links. As mobile devices dominate how people pay bills, shop, and communicate, phishing attacks (a form of fraudulent message-based scamming) are becoming more popular among bad actors.