<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Security-Vulnerability - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/security-vulnerability/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 23 Jul 2026 14:59:25 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/security-vulnerability/feed.xml" rel="self" type="application/rss+xml"/><item><title>Auth.js (next-auth) v5 Configuration Error Leads to Authentication Bypass</title><link>https://feed.craftedsignal.io/briefs/2026-07-authjs-fail-open/</link><pubDate>Thu, 23 Jul 2026 14:59:25 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-authjs-fail-open/</guid><description>A critical configuration error vulnerability in `next-auth` (Auth.js) v5 applications, specifically versions v5.0.0-beta.0 through v5.0.0-beta.31, can lead to a 'fail-open' state where server-side configuration issues cause the `auth` object to be populated with an error instead of `null`, effectively bypassing authentication checks and granting unauthorized access to protected resources.</description><content:encoded><![CDATA[<p>Auth.js (next-auth) v5 applications are affected by a critical configuration error vulnerability, GHSA-8fpg-xm3f-6cx3, where misconfigurations can lead to a &quot;fail-open&quot; state, bypassing authentication. This issue, first published on July 23, 2026, impacts versions <code>v5.0.0-beta.0</code> through <code>v5.0.0-beta.31</code>. When server-side configuration errors occur, such as missing OAuth provider settings or an unset <code>AUTH_SECRET</code>, the <code>auth</code> object, typically used to gate access, is erroneously populated with an error object instead of being <code>null</code>. This truthy error object causes common session existence checks (e.g., <code>if (req.auth)</code>) to evaluate as true for all incoming requests, including unauthenticated ones. Consequently, the application grants unauthorized access to protected resources, treating all visitors as authenticated. This silent failure mode poses a severe risk as it effectively renders authentication mechanisms useless without immediate detection.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An Auth.js <code>next-auth</code> v5 application is deployed, utilizing existence-based session checks (e.g., <code>if (req.auth)</code> or <code>!!auth</code>) in middleware or route handlers to protect resources.</li>
<li>A server-side configuration error occurs within the Auth.js setup, such as an incomplete OAuth provider configuration (e.g., missing <code>issuer</code> or <code>authorization</code> endpoints for Keycloak) or an unset <code>AUTH_SECRET</code> environment variable.</li>
<li>This misconfiguration causes Auth.js to log an internal error (e.g., <code>[auth][error] InvalidEndpoints</code>) and populate the <code>auth</code> object, typically used for session data, with an error object instead of <code>null</code>.</li>
<li>When the application's middleware or route handlers perform a session check (e.g., <code>const isLoggedIn = !!auth</code>), the truthy error object causes <code>isLoggedIn</code> to evaluate as <code>true</code>.</li>
<li>All subsequent requests, including those from unauthenticated users, are treated as if they possess a valid session.</li>
<li>The application &quot;fails open,&quot; granting unauthorized access to protected resources and routes that were intended for authenticated users only.</li>
<li>This authentication bypass occurs silently, as the application behaves as if a valid session exists for every request, potentially leading to widespread unauthorized access without explicit error indications to the user or administrators.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability, an instance of CWE-636 (Not Failing Securely / &quot;Failing Open&quot;) leading to improper authorization (CWE-285), can lead to severe consequences. If an affected application becomes misconfigured, all protected resources become openly accessible to anyone, regardless of authentication status. The failure is silent, meaning administrators may not be immediately aware that their authentication mechanisms are bypassed. This could result in unauthorized data exposure, manipulation, or complete compromise of systems, impacting confidentiality, integrity, and availability. While no specific victim count is provided, any organization using vulnerable <code>next-auth</code> versions with the described access pattern is at risk, particularly those with dynamic deployment environments where configuration changes are frequent.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>next-auth</code> to the patched version (<code>next-auth@beta</code> or later stable release) immediately to ensure configuration errors fail closed.</li>
<li>Modify existing session checks in <code>next-auth</code> middleware and route handlers to explicitly check for a user or session property (e.g., <code>!!req.auth?.user</code>) instead of just <code>!!req.auth</code> to prevent misconfiguration from being treated as a valid session.</li>
<li>Implement robust deployment pipeline checks to monitor for <code>[auth][error]</code> log messages from your application, treating them as critical failures to prevent misconfigured applications from reaching production environments.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>authentication-bypass</category><category>configuration-error</category><category>web-application</category><category>security-vulnerability</category></item></channel></rss>