Skip to content
CVE-2026-114607 IBM QRadar · QRadar

Detect better-auth OAuth State Reuse as Magic Link for Account Takeover (CVE-2026-114607) in IBM QRadar

Detects potential exploitation of CVE-2026-114607, an authentication bypass in the better-auth npm package (>= 1.4.0-beta.18, < 1.7.7). The OAuth 'state' parameter generated during the OAuth sign-in flow can be replayed against the Magic Link verification endpoint, allowing an attacker to sign in as another user (account takeover). Detection focuses on application and reverse-proxy logs showing OAuth state tokens being submitted to magic-link verification endpoints, cross-endpoint token reuse, and anomalous session issuance following magic-link verification without a preceding magic-link email request. Also surfaces the presence of vulnerable better-auth versions via package inventory telemetry.

MITRE ATT&CK

Tactic
Initial Access Persistence Credential Access

QRadar Detection Query

IBM QRadar (QRadar)
sql
-- df00tech DF00-9eef098f84 · https://df00tech.com/detections/CVE-2026-114607 · licence: https://df00tech.com/detections/licence
SELECT starttime, url, sourceip, "User Agent" FROM events WHERE (url ILIKE '%/api/auth/magic-link%' OR url ILIKE '%/api/auth/sign-in/magic-link%') AND (url ILIKE '%token=%' OR url ILIKE '%state=%') AND LOGSOURCETYPENAME(devicetype) ILIKE '%web%' ORDER BY starttime DESC LAST 24 HOURS
high severity low confidence

Surfaces requests to better-auth magic-link endpoints carrying token/state parameters for manual correlation against OAuth state issuance (CVE-2026-114607).

Data Sources

Web Server LogsReverse Proxy Logs

Required Tables

events

False Positives & Tuning

  • Vulnerability scanners probing auth endpoints.
  • Legitimate magic-link verifications.
  • Synthetic monitoring hitting auth routes.

Other platforms for CVE-2026-114607


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 OAuth state reuse against magic-link verify endpoint

    Expected signal: Web access logs show an OAuth state value followed by a magic-link verify request carrying the same token within seconds.

  2. Test 2 Magic-link verification without prior email request

    Expected signal: A magic-link verification event with no preceding magic-link email request record in better-auth logs.

  3. Test 3 Vulnerable better-auth version inventory

    Expected signal: Package inventory / EDR software telemetry records better-auth version in the vulnerable range (>=1.4.0-beta.18, <1.7.7).


Response Playbook

Triage

  1. Confirm the better-auth version in use from package-lock.json / node_modules; versions >= 1.4.0-beta.18 and < 1.7.7 are vulnerable.
  2. Identify the token value flagged and determine whether it was first issued as an OAuth 'state' parameter and later presented to a magic-link verify endpoint.
  3. Check whether a corresponding magic-link email was ever requested/sent for the account the session was issued to; absence strongly indicates exploitation.
  4. Review the source IP, user agent, and geolocation of the OAuth state issuance versus the magic-link verification to detect mismatch.

Containment

  1. Upgrade better-auth to >= 1.7.7 immediately across all affected services and redeploy.
  2. Invalidate all active sessions and force re-authentication for potentially affected accounts; rotate session secrets.
  3. Temporarily disable the magic-link plugin or add a WAF rule rejecting magic-link verify requests whose token matches an outstanding OAuth state.

Evidence Collection

  1. Preserve web/reverse-proxy access logs showing the OAuth callback and the magic-link verification requests with full query strings.
  2. Export better-auth server logs and the verification/session tables (session issuance records, token records) for the affected time window.

Escalation Criteria

  • !A session was issued to an account for which no magic-link request exists, treat as confirmed account takeover and escalate to IR.
  • !Evidence of multiple accounts targeted or privileged/admin account compromise.

Investigation Guide

Forensic Artifacts

  • >Web/reverse-proxy access logs containing OAuth callback and magic-link verify requests with query strings.
  • >better-auth session and verification token database tables.
  • >Application logs recording session issuance events and associated user IDs.

Tuning Guidance

Baseline legitimate magic-link verification volume per application. Exclude known scanner IPs and synthetic monitors. If query-string logging is normalized or truncated, enable full URI query capture at the reverse proxy to make token correlation reliable. Tighten the correlation window from 1h as you learn the normal OAuth-to-session latency for your deployment.


Hunting Queries

Finds a single token value appearing across both OAuth and magic-link endpoints, the core indicator of state reuse.

Hunting — KQL
kql
// df00tech DF00-9eef098f84 · https://df00tech.com/detections/CVE-2026-114607 · licence: https://df00tech.com/detections/licence
AppServiceHTTPLogs | where CsUriStem has "/api/auth/magic-link" | extend tok=extract(@"(?:token|state)=([A-Za-z0-9\-_\.]+)",1,CsUriQuery) | summarize endpoints=make_set(CsUriStem), count() by tok | where array_length(endpoints) > 1
Hunting — SPL
spl
``` df00tech DF00-9eef098f84 · https://df00tech.com/detections/CVE-2026-114607 · licence: https://df00tech.com/detections/licence ```
index=web (uri_path="/api/auth/magic-link*" OR uri_query="*state=*") | rex field=uri_query "(?:token|state)=(?<tok>[A-Za-z0-9\-_\.]+)" | stats dc(uri_path) as paths values(uri_path) as seen by tok | where paths>1

Atomic Red Team Tests

Test 1 OAuth state reuse against magic-link verify endpoint
linux

In a lab better-auth instance (< 1.7.7), capture an OAuth state value and replay it against the magic-link verification endpoint.

Command

bash
STATE=$(curl -sic 'http://localhost:3000/api/auth/sign-in/social?provider=github' | grep -oE 'state=[A-Za-z0-9._-]+' | head -1 | cut -d= -f2); curl -s "http://localhost:3000/api/auth/magic-link/verify?token=${STATE}" -c /tmp/ba_session.txt -v

Cleanup

bash
rm -f /tmp/ba_session.txt

Expected Telemetry

Web access logs show an OAuth state value followed by a magic-link verify request carrying the same token within seconds.

Expected Detection

The KQL/SPL correlation rule fires on the shared token value across OAuth and magic-link endpoints.

Test 2 Magic-link verification without prior email request
linux

Submit a magic-link verify request using a token that was never issued via a sign-in/magic-link email request.

Command

bash
curl -s 'http://localhost:3000/api/auth/magic-link/verify?token=ABORROWEDOAUTHSTATEVALUE1234' -c /tmp/ba_ses2.txt -v

Cleanup

bash
rm -f /tmp/ba_ses2.txt

Expected Telemetry

A magic-link verification event with no preceding magic-link email request record in better-auth logs.

Expected Detection

Triage logic flags session issuance lacking a corresponding magic-link request.

Test 3 Vulnerable better-auth version inventory
linux

Enumerate the installed better-auth version to confirm exposure to CVE-2026-114607.

Command

bash
node -e "console.log(require('better-auth/package.json').version)" || cat node_modules/better-auth/package.json | grep '\"version\"'

Cleanup

bash
true

Expected Telemetry

Package inventory / EDR software telemetry records better-auth version in the vulnerable range (>=1.4.0-beta.18, <1.7.7).

Expected Detection

Software inventory detection flags the vulnerable version.

Related Detections