Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

GHSA-qq9h-g4jm-xgf3

HIGHFix: better-auth/better-auth#10239

GHSA-qq9h-g4jm-xgf3 is a high-severity (CVSS 8.3) Improper Authentication vulnerability in better-auth. O3 Security confirms whether GHSA-qq9h-g4jm-xgf3 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in

Also known asCVE-2026-67327
Published
Jul 24, 2026
Updated
Aug 2, 2026
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Aug 2, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Real-World Exposure

2 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.

better-authnpm
6.7Mdownloads / week

Description

Am I affected

You are affected if all of the following hold:

  • You run a better-auth version below 1.6.22, or a 1.7.0-beta below 1.7.0-beta.10.
  • You enable the magic-link plugin or the email-OTP plugin.
  • You also enable email and password sign-up with open registration.
  • An account can exist at an address before its owner first signs in with the passwordless flow.

Summary

An attacker can keep password access to a victim's account after the victim starts using it. The attack runs in three steps. First, with open registration, the attacker signs up using the victim's email and a password the attacker picks. The account stays unverified, so the attacker cannot use it yet. Later the real owner signs in with a magic link or an email OTP. That step marks the account verified, and the attacker's password now works on it.

Details

When an account already exists for an address, magic-link verification and email-OTP sign-in both sign in to that account. They mark it verified and issue a session. Before the fix, neither one removed a password set while the account was still unverified. Neither one revoked existing sessions. So a password set before anyone proved control of the mailbox kept working after the owner proved control.

This is a pre-account-hijacking weakness. It is the same class as the OAuth advisory GHSA-g38m-r43w-p2q7, applied to the passwordless email flows. Requiring email verification does not stop it. The verification step is the exact moment that turns the planted account into a usable one.

The fix treats current proof of control over the address as authoritative. When either flow finds an account whose email was never confirmed, it now removes the password and revokes existing sessions first. Only then does it mark the account verified and issue the new session. The owner signs in as before. Only access created before the proof is removed.

Patches

Upgrade to better-auth 1.6.22 or later on the stable line. On the 1.7 pre-release line, upgrade to 1.7.0-beta.10 or later. Earlier 1.7 betas, up to and including 1.7.0-beta.9, still contain the bug.

Workarounds

If you cannot upgrade right away, you can lower the risk in two ways. Require email verification before you accept any password on an account. Remove unverified accounts quickly, so an address cannot sit reserved for long. Both steps shrink the opening, but they do not close it. Upgrading is the real fix.

Impact

The attacker gains lasting password access to an account the victim depends on, alongside the victim. From there the attacker can read and change the victim's data. The attacker can also reset the credentials and lock the victim out. The takeover only completes when the victim signs in through the passwordless flow. It also needs a setup that pairs that flow with open email and password sign-up.

Credit

Reported by the Vercel security team.

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmbetter-auth1.1.3&&< 1.6.221.6.22
📦npmbetter-auth1.7.0-beta.0&&< 1.7.0-beta.101.7.0-beta.10

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for better-auth. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update better-auth to 1.6.22 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qq9h-g4jm-xgf3 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qq9h-g4jm-xgf3 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qq9h-g4jm-xgf3. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Am I affected You are affected if all of the following hold: - You run a `better-auth` version below 1.6.22, or a `1.7.0-beta` below `1.7.0-beta.10`. - You enable the magic-link plugin or the email-OTP plugin. - You also enable email and password sign-up with open registration. - An account can exist at an address before its owner first signs in with the passwordless flow. ### Summary An attacker can keep password access to a victim's account after the victim starts using it. The attack runs in three steps. First, with open registration, the attacker signs up using the victim's email a
O3 Security · Impact-Aware SCA

Is GHSA-qq9h-g4jm-xgf3 in your dependencies?

O3 detects GHSA-qq9h-g4jm-xgf3 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-qq9h-g4jm-xgf3: better-auth (High 8.3) | O3 Security