Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain valid Better Auth session
-
DeliveryPOST /sso/register with skipDiscovery:true
-
ExploitStore attacker userInfo/token/JWKS URLs
-
ExecutionTrigger OIDC callback fetch
-
PersistServer reflects internal/metadata response body
-
ImpactExfiltrate 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
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.
Primary rating from Vendor (https://github.com/better-auth/better-auth).
CVSS VectorVendor: https://github.com/better-auth/better-auth
DescriptionCVE.org
Am I affected?
Users are affected if all of the following are true:
- Their application uses
@better-auth/ssoat a version>= 0.1.0, < 1.6.11on the stable line, or any1.7.0-beta.xon the pre-release line. - The
sso()plugin is added to their application'sbetterAuth({ 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
emailoverlaps with attacker-chosen domains.
If developers do not enable the SSO plugin, their application is not affected.
Fix:
- Upgrade to
@better-auth/sso@1.6.11or later. - 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:
- Its host is publicly routable on the internet, evaluated through the
@better-auth/core/utils/host.isPublicRoutableHostgate. RFC 1918 private ranges, RFC 4193 unique-local addresses, link-local addresses (including the cloud-metadata IP169.254.169.254), loopback, multicast, broadcast, and reserved ranges are rejected, along with cloud-metadata FQDNs. - Its origin is already listed in the application's
trustedOriginsconfiguration. 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/registerregardless ofskipDiscovery. - Reverse-proxy gate: block
POST /sso/registerandPOST /sso/update-providerat 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: falseuntil 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 assertingemailVerified: truefor an arbitrary email, triggering OAuth auto-link against pre-existing user rows.
Credit
Reported by Vaadata.
Resources
Articles & Coverage 1
Executive ViewAI
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
Privilege escalation to root in the LiteSpeed User-End cPanel Plugin (versions 2.3 through before 2.4.5) lets attackers
An issue was found in Apache Airflow versions 1.10.10 and below. Rated critical severity (CVSS 9.8), this vulnerability
Alpine Linux: valkey fixed in 7.2.7-r0
UAF in Redis 8.2.1 via crafted Lua scripts by authenticated users. EPSS 12.4%. Patch available.
Authenticated Redis users with permission to run server-side Lua can trigger an integer overflow (CWE-190) in the bundle
It was discovered, that redis, a persistent key-value database, due to a packaging issue, is prone to a (Debian-specific
Memory Corruption was discovered in the cmsgpack library in the Lua subsystem in Redis before 3.2.12, 4.x before 4.0.10,
Redis before 2.8.21 and 3.x before 3.0.2 allows remote attackers to execute arbitrary Lua bytecode via the eval command.
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
Authenticated Lua script execution in Redis 8.2.1 and earlier can be abused with a crafted long-string delimiter to trig
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 is a sandbox-escape flaw in Redis's embedded Lua scripting engine (all versions up to and including 8.2.1
EUVD-2026-44733
GHSA-5rr4-8452-hf4v
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB