Skip to main content

Better Auth SSO CVE-2026-53513

| EUVDEUVD-2026-44733 CRITICAL
Improper Input Validation (CWE-20)
2026-07-07 https://github.com/better-auth/better-auth GHSA-5rr4-8452-hf4v
9.6
CVSS 3.1 · Vendor: https://github.com/better-auth/better-auth
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain valid Better Auth session
  2. Delivery
    POST /sso/register with skipDiscovery:true
  3. Exploit
    Store attacker userInfo/token/JWKS URLs
  4. Execution
    Trigger OIDC callback fetch
  5. Persist
    Server reflects internal/metadata response body
  6. Impact
    Exfiltrate IAM credentials or forge emailVerified for account takeover

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires (1) the application to have the sso() plugin enabled, (2) an attacker holding any valid Better Auth session - the default gate on POST /sso/register accepts any authenticated session (matching CVSS PR:L) - and (3) the attacker submitting the provider with skipDiscovery: true, which is the exact setting that bypasses validateDiscoveryUrl and persists the raw tokenEndpoint/userInfoEndpoint/jwksEndpoint URLs. Under those conditions the non-blind SSRF (cloud-metadata / internal-body exfiltration) needs no further configuration. The account-takeover escalation additionally requires the developer to have set trustEmailVerified: true AND a pre-existing user row whose email overlaps an attacker-chosen domain. Limiting factors: authentication is mandatory (no unauthenticated path), the SSO plugin must be installed, and the ATO tier depends on the non-default trustEmailVerified flag; the same primitive also exists on POST /sso/update-provider.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N yields 9.6 Critical, driven by network reach, low complexity, no user interaction, and a scope change (the auth server is pivoted to attack other systems). PR:L is accurate: exploitation requires a valid low-privilege Better Auth session, since the plugin's default gate on /sso/register accepts any authenticated session - this is the single most important limiter and means the attack surface depends on how easily an attacker can obtain a session (e.g., open self-registration widens it considerably). No EPSS score, KEV listing, or public POC was provided, so this is a high-severity-by-design issue rather than one with confirmed in-the-wild activity: no public exploit identified at time of analysis. The technical impact is high and the primitive is reliable (non-blind SSRF against cloud metadata is a well-understood, automatable class), so despite the authentication requirement this warrants prompt patching, especially for cloud-hosted deployments where IMDS credential theft is one request away.

Exploit ScenarioDerived

An attacker obtains any valid Better Auth session (e.g., via open user registration), then calls POST /sso/register with skipDiscovery: true and userInfoEndpoint set to http://169.254.169.254/latest/meta-data/iam/security-credentials/, completing an OIDC login flow so the server fetches that URL and reflects the AWS IAM credentials back through their user profile. Where the deployment sets trustEmailVerified: true, they instead point userInfo at an attacker server returning emailVerified:true for a victim's email to auto-link and take over that account. No public exploit is identified at time of analysis, but the low-complexity, no-interaction network vector makes reliable exploitation straightforward once a session is held.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 07, 2026

Server-side request forgery in the @better-auth/sso plugin (versions >= 0.1.0 through < 1.6.11, and 1.7.0-beta.x) lets any authenticated Better Auth session register an OIDC provider with attacker-controlled endpoint URLs, which the auth server then fetches during callback and reflects into the user profile - a non-blind SSRF exposing cloud metadata (IMDS 169.254.169.254), internal APIs, and localhost-bound services like Redis. When trustEmailVerified is enabled it escalates to full account takeover via forged emailVerified claims. Carrying a CVSS 9.6 (scope-changed) rating with no public exploit identified at time of analysis, the flaw was reported by Vaadata and fixed in 1.6.11.

RemediationAI

Vendor-released patch: @better-auth/sso@1.6.11 - upgrade to 1.6.11 or later, which validates each supplied OIDC endpoint URL at registration time (rejecting RFC 1918, RFC 4193 unique-local, link-local including 169.254.169.254, loopback, multicast, broadcast, reserved ranges and cloud-metadata FQDNs via isPublicRoutableHost) and tightens the schema from z.string() to z.url(); note that deployments running internal IdPs on private networks must add the IdP origin to trustedOrigins to keep working after upgrade. If you cannot upgrade immediately, set sso({ providersLimit: 0 }) to disable provider self-registration entirely (the limit is enforced before the schema branch, blocking every /sso/register), or block POST /sso/register and POST /sso/update-provider at a reverse proxy / restrict them to an admin IP denylist and user list. Add network egress controls blocking the auth server from reaching RFC 1918, RFC 4193, link-local ranges and cloud-metadata FQDNs, and on AWS enforce IMDSv2 (HttpTokens: required) to blunt credential theft; also set trustEmailVerified: false to remove the account-takeover escalation, though this caps but does not eliminate the SSRF. See the advisory at https://github.com/better-auth/better-auth/security/advisories/GHSA-5rr4-8452-hf4v.

Affected VersionsENISA

sso 0.1.0, < 1.6.11
better-auth 0.1.0, < 1.6.11

Affected Packages

npm @better-auth/sso fix: 1.6.11
euvd better_auth_0_1_0 fix: 1.6.11
euvd sso_0_1_0 fix: 1.6.11

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in npm, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Better Auth is a TypeScript authentication framework; its @better-auth/sso plugin implements OIDC/SAML single sign-on. The vulnerability lives in provider registration (POST /sso/register) and update (POST /sso/update-provider), where the request schema typed the tokenEndpoint, userInfoEndpoint, and jwksEndpoint fields as bare z.string() with no .url() validator and no origin gate. When a caller sets skipDiscovery: true, these URLs bypass the validateDiscoveryUrl checks applied in the discovery branch and are persisted verbatim on the ssoProvider row. During the OIDC callback the server dereferences them at three fetch sites - validateAuthorizationCode (token), betterFetch (userInfo), and validateToken (JWKS) - turning stored attacker input into server-side HTTP requests. This is the classic CWE-918 SSRF pattern rooted in CWE-20 improper input validation (the CVE's assigned CWE), with the response-reflection making it non-blind; the account-linking escalation additionally maps to CWE-345 (insufficient verification of data authenticity) since a forged userInfo emailVerified:true is trusted for auto-linking.

Know when Redis gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/better-auth/better-auth) PRIMARY 9.6 CRITICAL
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
vuln.today AI 9.6 CRITICAL

Network-reachable endpoint needing only a low-privilege session (PR:L), no interaction; SSRF pivots to other systems (S:C) leaking secrets (C:H) and enabling account takeover (I:H), with no availability impact.

3.1 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:H/SI:L/SA:N

Primary rating from Vendor (https://github.com/better-auth/better-auth).

CVSS VectorVendor: https://github.com/better-auth/better-auth

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

Am I affected?

Users are affected if all of the following are true:

  • Their application uses @better-auth/sso at a version >= 0.1.0, < 1.6.11 on the stable line, or any 1.7.0-beta.x on the pre-release line.
  • The sso() plugin is added to their application's betterAuth({ plugins: [...] }) array.
  • Any user with a valid Better Auth session can reach POST /sso/register (the plugin's default gate accepts any session).

For the non-blind SSRF impact (full IAM credential or internal HTTP body exfiltration), no further configuration is required.

For the account takeover escalation, additionally:

  • Developers set sso({ trustEmailVerified: true, ... }).
  • The developer's application deployment has accounts whose email overlaps with attacker-chosen domains.

If developers do not enable the SSO plugin, their application is not affected.

Fix:

  1. Upgrade to @better-auth/sso@1.6.11 or later.
  2. If developers cannot upgrade, see workarounds below.

Summary

The @better-auth/sso plugin's POST /sso/register endpoint accepts attacker-controlled oidcConfig.userInfoEndpoint, tokenEndpoint, and jwksEndpoint URLs when skipDiscovery: true is set, persists them on the ssoProvider row without origin validation, then issues server-side fetches to those URLs during the OIDC callback. The fetched response body is reflected through the user profile, producing a non-blind SSRF reachable by any authenticated session. The same primitive exists on POST /sso/update-provider.

Details

The schema field types accept bare strings: no .url() validator, no origin gate. The discovery branch (skipDiscovery: false) routes URLs through validateDiscoveryUrl; the skip-discovery branch persists them as-is. At callback time three fetch sites read the stored URLs: validateAuthorizationCode for the token endpoint, betterFetch for the userInfo endpoint, and validateToken for the JWKS endpoint.

When trustEmailVerified: true is configured, the attacker can escalate to account linking. A malicious userInfo response with emailVerified: true and a chosen email triggers OAuth auto-link against any pre-existing user row with that email, compounding the SSRF into account takeover.

Patches

Fixed in @better-auth/sso@1.6.11. Provider registration (POST /sso/register with skipDiscovery: true) and every POST /sso/update-provider request now validate each supplied OIDC endpoint URL (authorizationEndpoint, tokenEndpoint, userInfoEndpoint, jwksEndpoint, discoveryEndpoint) at registration time. A URL is rejected unless it satisfies one of two conditions:

  1. Its host is publicly routable on the internet, evaluated through the @better-auth/core/utils/host.isPublicRoutableHost gate. RFC 1918 private ranges, RFC 4193 unique-local addresses, link-local addresses (including the cloud-metadata IP 169.254.169.254), loopback, multicast, broadcast, and reserved ranges are rejected, along with cloud-metadata FQDNs.
  2. Its origin is already listed in the application's trustedOrigins configuration. This preserves the documented escape hatch for customers running internal IdPs intentionally on private networks.

The schema also tightens from z.string() to z.url() on those fields, so malformed URLs fail at parse time rather than at fetch time. Deployments running internal IdPs that previously worked must add the IdP's origin to trustedOrigins to keep working after upgrade.

Workarounds

If developers cannot upgrade immediately:

  • Disable provider self-registration: set sso({ providersLimit: 0 }). The limit is enforced before the schema branch, blocking every /sso/register regardless of skipDiscovery.
  • Reverse-proxy gate: block POST /sso/register and POST /sso/update-provider at the edge, or restrict to a denylist of source IPs and a small admin user list.
  • Network-level egress controls: block egress from the auth server to RFC 1918, RFC 4193, link-local ranges (169.254.0.0/16, fe80::/10), and the cloud-metadata FQDN list at the firewall or VPC level. AWS users should additionally enforce IMDSv2 (HttpTokens: required).
  • Set trustEmailVerified: false until upgrade. This caps the impact at non-blind SSRF and removes the account-takeover escalation, but does not stop the SSRF.

Impact

  • Server-Side Request Forgery (non-blind): the attacker reads response bodies from any HTTP endpoint reachable from the auth server, including cloud metadata services (AWS IMDS, GCP metadata FQDN), internal-only APIs, and infrastructure services such as Redis or admin panels bound to localhost.
  • Account takeover (when trustEmailVerified: true): the attacker mints a malicious userInfo response asserting emailVerified: true for an arbitrary email, triggering OAuth auto-link against pre-existing user rows.

Credit

Reported by Vaadata.

Resources

Executive ViewAI

Why It Matters

A critical server-side request forgery vulnerability in the @better-auth/sso plugin (versions <1.6.11) allows authenticated users to expose cloud metadata and internal services; when email verification is enabled, this escalates to complete account takeover. This threatens the integrity of cloud infrastructure credentials and user account security across all deployments using affected versions.

Business Impact: Severe
Compensating Controls

Apply vendor patch: upgrade to @better-auth/sso version 1.6.11 or later. Interim mitigation only: disable trustEmailVerified in authentication configuration if patch deployment is delayed.

Threat Intelligence Overview

EPSS Score
0.3%
Top 83% exploitable
Prevalence
Low
niche npm SSO plugin for the newer Better Auth framework
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

48
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +48
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

More in Redis

View all
CVE-2026-48172 CRITICAL POC
10.0 May 21

Privilege escalation to root in the LiteSpeed User-End cPanel Plugin (versions 2.3 through before 2.4.5) lets attackers

CVE-2020-11981 CRITICAL POC
9.8 Jul 17

An issue was found in Apache Airflow versions 1.10.10 and below. Rated critical severity (CVSS 9.8), this vulnerability

CVE-2024-31449 HIGH
8.8

Alpine Linux: valkey fixed in 7.2.7-r0

CVE-2025-49844 CRITICAL POC
9.9 Oct 03

UAF in Redis 8.2.1 via crafted Lua scripts by authenticated users. EPSS 12.4%. Patch available.

CVE-2025-46817 HIGH POC
8.8 Oct 03

Authenticated Redis users with permission to run server-side Lua can trigger an integer overflow (CWE-190) in the bundle

CVE-2022-0543 CRITICAL POC
10.0 Feb 18

It was discovered, that redis, a persistent key-value database, due to a packaging issue, is prone to a (Debian-specific

CVE-2018-11218 CRITICAL POC
9.8 Jun 17

Memory Corruption was discovered in the cmsgpack library in the Lua subsystem in Redis before 3.2.12, 4.x before 4.0.10,

CVE-2015-4335 CRITICAL POC
10.0 Jun 09

Redis before 2.8.21 and 3.x before 3.0.2 allows remote attackers to execute arbitrary Lua bytecode via the eval command.

CVE-2016-8339 CRITICAL POC
9.8 Oct 28

A buffer overflow in Redis 3.2.x prior to 3.2.4 causes arbitrary code execution when a crafted command is sent. Rated cr

CVE-2025-46819 HIGH POC
7.1 Oct 03

Authenticated Lua script execution in Redis 8.2.1 and earlier can be abused with a crafted long-string delimiter to trig

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2025-46818 HIGH POC
7.3 Oct 03

CVE-2025-46818 is a sandbox-escape flaw in Redis's embedded Lua scripting engine (all versions up to and including 8.2.1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy