Intel

AIKIDO-2026-379318

better-auth is vulnerable to Cross-Site Request Forgery (CSRF)

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 24, 2026
July 24, 2026

53

CVE Score

Medium

Cross-Site Request Forgery (CSRF)

Are you affected? Scan for Free

TL;DR

The magic-link (/sign-in/magic-link) and email-OTP (/email-otp/send-verification-otp) plugin send endpoints do not validate the Origin header on cookieless requests. A cookieless cross-origin POST is accepted and triggers an outbound magic-link or verification email to the address supplied in the request body, so an attacker can drive emails to arbitrary recipients from the victim application. The equivalent built-in /sign-in/email and /sign-up/email routes already enforced this origin check, but the plugin send routes were not covered. The fix attaches the shared CSRF/origin middleware to both plugin send endpoints while still allowing legitimate server-to-server requests that carry no Origin header.

How do I fix this?

Upgrade the better-auth library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you enable the magic link or email OTP plugin.

Versions

0.1.0 - 1.6.23

Fixed in 1.6.24

Background info

better-auth is vulnerable to Cross-Site Request Forgery (CSRF) in versions 0.1.0 - 1.6.23.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea