@better-auth/sso provider registration has server-side request forgery via unvalidated OIDC endpoints (CVE-2026-53513)
The @better-auth/sso plugin versions >=0.1.0 and <1.6.11 contain a server-side request forgery (SSRF) vulnerability via unvalidated OpenID Connect (OIDC) endpoint URLs when skipDiscovery is set to true. Authenticated users can exploit this by registering malicious OIDC providers, causing the server to fetch attacker-controlled URLs. This can lead to reading internal HTTP responses, including cloud metadata services. If trustEmailVerified is enabled, attackers can escalate to account takeover by forging verified email claims that link to existing user accounts. The issue is fixed in version 1.6.11 by validating OIDC endpoint URLs against public routability or trusted origins and tightening schema validation. Workarounds include disabling provider self-registration, restricting access, network egress controls, and disabling trustEmailVerified until patched.
AI Analysis
Technical Summary
The vulnerability exists in the @better-auth/sso plugin's POST /sso/register and POST /sso/update-provider endpoints when skipDiscovery: true is set. These endpoints accept attacker-controlled OIDC endpoint URLs (userInfoEndpoint, tokenEndpoint, jwksEndpoint) without origin validation and persist them. During the OIDC callback, the server fetches these URLs, enabling non-blind SSRF by reflecting fetched response bodies through the user profile. When trustEmailVerified: true is configured, attackers can escalate to account takeover by forging userInfo responses with emailVerified: true and an attacker-chosen email that matches existing accounts, triggering OAuth auto-linking. The fix in version 1.6.11 enforces validation of OIDC endpoint URLs to ensure they are either publicly routable or listed in trustedOrigins, and schema validation is tightened from string to URL format. Workarounds include disabling provider registration, restricting access to registration endpoints, network egress filtering, and disabling trustEmailVerified until upgrade.
Potential Impact
An attacker with any valid Better Auth session can exploit this vulnerability to perform non-blind SSRF, reading response bodies from internal or cloud metadata endpoints accessible from the auth server. This includes sensitive infrastructure services and cloud metadata APIs (e.g., AWS IMDS). If trustEmailVerified is enabled, the attacker can escalate the SSRF to account takeover by forging verified email claims that link to existing user accounts, allowing unauthorized access. The vulnerability does not impact availability but compromises confidentiality and integrity of user accounts and internal services.
Mitigation Recommendations
A fix is available in @better-auth/sso version 1.6.11 and later, which validates OIDC endpoint URLs at registration and update time to prevent SSRF. Users should upgrade to this version promptly. If immediate upgrade is not possible, apply the following workarounds: disable provider self-registration by setting providersLimit to 0; restrict access to POST /sso/register and POST /sso/update-provider endpoints via reverse proxy or IP/user allowlists; implement network-level egress controls blocking access to private IP ranges, link-local addresses, and cloud metadata endpoints; and set trustEmailVerified to false to prevent account takeover escalation. After upgrading, deployments using internal IdPs must add their origins to trustedOrigins to maintain functionality.
@better-auth/sso provider registration has server-side request forgery via unvalidated OIDC endpoints (CVE-2026-53513)
Description
The @better-auth/sso plugin versions >=0.1.0 and <1.6.11 contain a server-side request forgery (SSRF) vulnerability via unvalidated OpenID Connect (OIDC) endpoint URLs when skipDiscovery is set to true. Authenticated users can exploit this by registering malicious OIDC providers, causing the server to fetch attacker-controlled URLs. This can lead to reading internal HTTP responses, including cloud metadata services. If trustEmailVerified is enabled, attackers can escalate to account takeover by forging verified email claims that link to existing user accounts. The issue is fixed in version 1.6.11 by validating OIDC endpoint URLs against public routability or trusted origins and tightening schema validation. Workarounds include disabling provider self-registration, restricting access, network egress controls, and disabling trustEmailVerified until patched.
CVSS v3.1
Score 9.6critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in the @better-auth/sso plugin's POST /sso/register and POST /sso/update-provider endpoints when skipDiscovery: true is set. These endpoints accept attacker-controlled OIDC endpoint URLs (userInfoEndpoint, tokenEndpoint, jwksEndpoint) without origin validation and persist them. During the OIDC callback, the server fetches these URLs, enabling non-blind SSRF by reflecting fetched response bodies through the user profile. When trustEmailVerified: true is configured, attackers can escalate to account takeover by forging userInfo responses with emailVerified: true and an attacker-chosen email that matches existing accounts, triggering OAuth auto-linking. The fix in version 1.6.11 enforces validation of OIDC endpoint URLs to ensure they are either publicly routable or listed in trustedOrigins, and schema validation is tightened from string to URL format. Workarounds include disabling provider registration, restricting access to registration endpoints, network egress filtering, and disabling trustEmailVerified until upgrade.
Potential Impact
An attacker with any valid Better Auth session can exploit this vulnerability to perform non-blind SSRF, reading response bodies from internal or cloud metadata endpoints accessible from the auth server. This includes sensitive infrastructure services and cloud metadata APIs (e.g., AWS IMDS). If trustEmailVerified is enabled, the attacker can escalate the SSRF to account takeover by forging verified email claims that link to existing user accounts, allowing unauthorized access. The vulnerability does not impact availability but compromises confidentiality and integrity of user accounts and internal services.
Mitigation Recommendations
A fix is available in @better-auth/sso version 1.6.11 and later, which validates OIDC endpoint URLs at registration and update time to prevent SSRF. Users should upgrade to this version promptly. If immediate upgrade is not possible, apply the following workarounds: disable provider self-registration by setting providersLimit to 0; restrict access to POST /sso/register and POST /sso/update-provider endpoints via reverse proxy or IP/user allowlists; implement network-level egress controls blocking access to private IP ranges, link-local addresses, and cloud metadata endpoints; and set trustEmailVerified to false to prevent account takeover escalation. After upgrading, deployments using internal IdPs must add their origins to trustedOrigins to maintain functionality.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-5rr4-8452-hf4v
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-53513"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a4e4ef7c9d9e3dbe328cc01
Added to database: 07/08/2026, 13:21:59 UTC
Last enriched: 07/08/2026, 13:44:27 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 40
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.