<?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>Auth.js - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/auth.js/</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/vendors/auth.js/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><item><title>Auth.js getToken() Vulnerability Leads to Denial of Service</title><link>https://feed.craftedsignal.io/briefs/2026-07-authjs-dos/</link><pubDate>Thu, 23 Jul 2026 14:45:37 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-authjs-dos/</guid><description>A vulnerability in the Auth.js `getToken()` helper function (next-auth and @auth/core) allows unauthenticated attackers to trigger an uncaught exception via a malformed `Authorization: Bearer` header, leading to a per-request denial of service in affected applications.</description><content:encoded><![CDATA[<p>A high-severity vulnerability has been identified in the <code>getToken()</code> helper within the <code>next-auth</code> and <code>@auth/core</code> JavaScript libraries, specifically affecting versions <code>&lt;= 5.0.0-beta.25</code> for <code>next-auth</code> and <code>&lt; 0.41.3</code> for <code>@auth/core</code>. This flaw, tracked as CWE-20 (Improper Input Validation), enables an unauthenticated attacker to induce a denial-of-service condition. When an application that directly calls <code>getToken()</code> receives a request with a malformed <code>Authorization: Bearer</code> header containing invalid percent-encoding, the function attempts to URL-decode the value. This decoding step can trigger an uncaught exception if not explicitly handled by the application, causing the request handler to crash or become unresponsive. This impacts application availability, particularly in API routes, middleware, and server-side request handlers where <code>getToken()</code> is commonly employed, though it does not expose sensitive data or bypass authentication.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated attacker crafts an HTTP request targeting a web application that uses the vulnerable <code>getToken()</code> helper.</li>
<li>The attacker includes a malformed <code>Authorization: Bearer</code> header in the request, where the bearer token portion contains invalid percent-encoding (e.g., <code>%xx</code> where <code>xx</code> is not a valid hexadecimal character).</li>
<li>The web application's API route, middleware, or server-side request handler receives the malicious request and calls the <code>getToken()</code> function.</li>
<li>The <code>getToken()</code> function, in the absence of a session cookie, attempts to URL-decode the malformed bearer value from the <code>Authorization</code> header.</li>
<li>Due to the invalid percent-encoding, the URL-decoding process fails and throws an uncaught exception within the <code>getToken()</code> helper.</li>
<li>Unless the application has a specific <code>try/catch</code> block surrounding the <code>getToken()</code> call, this uncaught exception propagates, leading to the crash or unresponsiveness of the request handler.</li>
<li>The application experiences a denial-of-service condition for that specific request, impacting availability.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The primary impact of this vulnerability is a denial of service (DoS). An unauthenticated request containing a specially crafted, malformed <code>Authorization: Bearer</code> header can cause an unhandled exception in any application handler that invokes the <code>getToken()</code> function directly. This results in the affected request failing to complete, rendering the specific endpoint unavailable for that transaction. The impact is isolated to individual requests and primarily affects application availability. It does not lead to the exposure of tokens, session data, or other sensitive information, nor does it bypass existing authentication mechanisms. The vulnerability is categorized under CWE-20: Improper Input Validation.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>next-auth</code> to a patched version greater than <code>5.0.0-beta.31</code> or <code>4.24.14</code> (or <code>@auth/core</code> to <code>0.41.3</code> or newer) to automatically address the vulnerability.</li>
<li>If immediate upgrade is not possible, implement a <code>try/catch</code> block around all calls to <code>getToken()</code> within your application code to handle potential exceptions gracefully and treat them as an invalid token.</li>
<li>Consider deploying an edge proxy or middleware to strip or normalize incoming <code>Authorization</code> headers with malformed percent-encoding before they reach the application.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>denial-of-service</category><category>vulnerability</category><category>web-application</category><category>javascript</category><category>input-validation</category></item><item><title>Auth.js Email Normalizer Vulnerability Allows Homoglyph Bypass Leading to Account Takeover</title><link>https://feed.craftedsignal.io/briefs/2026-07-authjs-homoglyph-bypass/</link><pubDate>Thu, 23 Jul 2026 14:42:37 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-authjs-homoglyph-bypass/</guid><description>A critical vulnerability in Auth.js libraries (next-auth and @auth/core) affects the email/magic-link sign-in flow, allowing an attacker to craft an email address with a homoglyph character that bypasses validation before Unicode normalization, leading to magic links being misrouted to attacker-controlled mailboxes and enabling account takeover without victim interaction.</description><content:encoded><![CDATA[<p>A critical vulnerability exists in Auth.js, specifically affecting <code>next-auth</code> versions <code>&gt;= 4.0.0, &lt; 4.24.14</code>, <code>&gt;= 4.10.3, &lt; 4.24.15</code>, <code>&gt;= 5.0.0-beta.1, &lt;= 5.0.0-beta.31</code> and <code>@auth/core</code> versions <code>&gt;= 0.1.0, &lt; 0.41.3</code>, when using the default email/magic-link sign-in provider. The flaw stems from the email normalizer validating an address <em>before</em> applying Unicode normalization (NFKC/NFKD). This allows an attacker to craft an email address containing a Unicode character that is not an ASCII <code>@</code> (U+0040) but canonicalizes to one after normalization. This bypasses the normalizer's single-<code>@</code> check, causing a downstream mail library that performs Unicode normalization to interpret the address with two <code>@</code> separators. Consequently, the passwordless sign-in link is misrouted to an attacker-controlled mailbox, enabling account takeover without requiring any victim interaction.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a target's email address and crafts a malicious version by inserting a Unicode homoglyph character that resembles '@' (e.g., <code>victim_email[U+XXXX]attacker.com</code>).</li>
<li>The attacker submits this crafted email address to the vulnerable Auth.js application's magic-link sign-in flow.</li>
<li>The application's default <code>normalizeIdentifier</code> function validates the address, incorrectly perceiving only one '@' symbol because validation occurs prior to Unicode normalization.</li>
<li>The application proceeds to send the magic-link email, with the crafted address passed to a downstream mail library or service.</li>
<li>The mail library or service, which performs Unicode normalization (e.g., NFKC) for internationalized email, processes the recipient address.</li>
<li>During normalization, the homoglyph character in the crafted email canonicalizes to a second '@' symbol (e.g., <code>victim_email@attacker.com</code>), causing the mail service to misroute the magic link.</li>
<li>The magic link is delivered to the attacker-controlled mailbox, enabling the attacker to authenticate and gain unauthorized access to the victim's account.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The primary impact of this vulnerability is account takeover. An attacker who knows a victim's email address can exploit this flaw to request a magic link that is subsequently delivered to an attacker-controlled mailbox. The attacker can then use this link to sign in as the victim, gaining full access to their account. No victim interaction is required for the link to be misrouted, as the attacker initiates and directly receives the authentication link. This can lead to unauthorized access to personal data, financial information, or sensitive corporate resources, depending on the scope and permissions of the compromised account.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>next-auth</code> to a patched version (currently pending, refer to GHSA-7rqj-j65f-68wh for updates) immediately.</li>
<li>Upgrade <code>@auth/core</code> to a patched version (currently pending, refer to GHSA-7rqj-j65f-68wh for updates) immediately.</li>
<li>If immediate upgrade is not possible, implement a custom <code>normalizeIdentifier</code> on the email provider that calls <code>identifier.normalize(&quot;NFKC&quot;)</code> <em>before</em> any validation, and ensures only one '@' remains after normalization, as detailed in the GHSA advisory.</li>
<li>Alternatively, as a workaround, reject any email addresses containing non-ASCII characters if your user base does not require internationalized email addresses.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>account-takeover</category><category>authentication-bypass</category><category>web-vulnerability</category><category>magic-link</category><category>unicode-normalization</category></item></channel></rss>