CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-8FPG-XM3F-6CX3

GHSA-8FPG-XM3F-6CX3: Authentication Fail-Open via Unvalidated Server Responses in Auth.js

Alon Barad
Alon Barad
Software Engineer

Jul 23, 2026·7 min read·3 visits

Executive Summary (TL;DR)

A failure to validate HTTP response status codes in the next-auth client wrapper allows unauthenticated remote requests to bypass access controls. When backend errors trigger an HTTP 500 response, the parsed JSON error body is evaluated as a valid user session, causing existence-based security checks to fail open.

In Auth.js (specifically next-auth version 5), server-side configuration errors or backend exceptions can cause existence-based authentication and authorization checks to fail open. When the underlying core engine (@auth/core) encounters a configuration error or runtime exception, it returns an HTTP 500 Internal Server Error response containing a JSON-formatted error description payload. Prior to the fix, the next-auth wrappers read this response body using response.json() without validating the HTTP status code. Because any parsed JavaScript object evaluates to truthy, common existence-based checks incorrectly evaluated to true, letting unauthenticated requests pass.

Vulnerability Overview

The Auth.js library (formerly next-auth) provides developers with a structured authentication wrapper for modern web applications. In next-auth version 5, the client-side wrappers interface directly with the core server-side engine via API endpoints to evaluate the authentication state of an incoming request. The vulnerability exists within this communication layer, specifically during scenarios where the core engine fails to process the request due to server-side exceptions or database connection outages.

Under normal execution, the server-side component of Auth.js processes session validation requests and returns a structured JSON payload representing the active user session. When authenticated, this payload is passed to middlewares, React Server Components (RSC), or edge handlers. However, if the session retrieval endpoint fails, it returns an HTTP 500 status code accompanied by a JSON payload describing the error.

The attack surface is exposed on any route that relies on existence-based truthiness checks of the session variable to restrict access. Because the integration layer failed to distinguish between successful session objects and server-side error descriptions, any server-side failure effectively dismantled the application's authentication boundary.

Root Cause Analysis

The root cause of this vulnerability lies in a combination of CWE-636 (Not Failing Closed) and CWE-252 (Unchecked Return Value). When the underlying @auth/core engine experiences a configuration mismatch, a database pool exhaustion, or an external OpenID Connect (OIDC) provider timeout, it responds to the client wrapper with an HTTP 500 status code. The body of this response contains a JSON payload detailing the exception message, such as {"message": "There was a problem with the server configuration..."}.

Prior to the patch, the next-auth integration wrappers received this HTTP response and directly resolved the promise chain by executing the .json() parsing method without evaluating the status code. The exact vulnerable instruction called getSession(_headers, _config).then((r) => r.json()) unconditionally, propagating the parsed JSON error object as the output of the session lookup function.

In JavaScript, truthiness evaluations govern common logic patterns. The only falsy values are null, undefined, false, 0, "" (empty string), and NaN. Consequently, a parsed JavaScript object representing an error evaluates to a boolean true. Because developers use existence checks like if (req.auth) or !!session to gate access, the wrapper passed this truthy error object to the authorization logic, successfully satisfying the check and failing open.

Code Analysis

An analysis of the patch deployed in commit d008b9b764bf4b322a87e1822d1dda7789258d8f confirms the exact structure of the vulnerability. The wrapper implementation previously fetched the session and immediately parsed the response block using the .json() method:

// VULNERABLE FUNCTION
export function initAuth(config: NextAuthConfig) {
  return async (...args) => {
    // ...
    return getSession(_headers, _config).then((r) => r.json())
  }
}

The vulnerability is remediated by introducing the parseSessionResponse helper function. This helper encapsulates the response evaluation logic by checking the boolean .ok attribute of the Response object before accessing the body parser. If the response code is outside the 2xx success range (such as HTTP 500), the helper returns null to ensure the session evaluates to falsy.

// SECURE REMEDIATION PATTERN
async function parseSessionResponse(
  response: Response
): Promise<Session | null> {
  // Ensure response was successful (status 200-299)
  if (!response.ok) return null
  return (await response.json()) satisfies Session | null
}
 
export function initAuth(config: NextAuthConfig) {
  return async (...args) => {
    // ...
    // Resolves to null on error response, causing existence checks to fail closed
    return getSession(_headers, _config).then(parseSessionResponse)
  }
}

This structural change guarantees that any server-side database disruption or integration failure returns null rather than an error object. The downstream middleware and routing mechanisms can then correctly evaluate the falsy session value and restrict route access.

Exploitation & Attack Methodology

To exploit this vulnerability, an attacker does not require pre-existing session tokens or credentials. The exploitation relies on triggering, or waiting for, an error state in the backend engine of the web application. Common vectors to induce this state include rate-limiting the application's connection to its database pool or targeting downstream third-party identity providers to cause network timeouts.

Once the backend is in an error-producing state, any request to a protected endpoint triggers the vulnerable getSession pathway. The application server attempts to validate the session, encounters the backend error, and returns an HTTP 500 status code with the JSON error metadata. The unpatched wrapper parses this payload and sets the session value to the error object, which the authorization logic accepts as a valid session.

The official test harness validates this bypass logic by using a malformed configuration block. By defining a provider that lacks crucial endpoint URLs, the engine is forced to crash. The test verifies that prior to the patch, the resulting 500 error permitted route access, whereas the patched implementation successfully sets the session context to null:

it("sets req.auth to null in the middleware wrapper", async () => {
  const { auth } = NextAuth(brokenConfig)
  let observed: unknown = "unset"
  const handler = auth((req) => {
    observed = req.auth
  })
  const req: any = new Request("https://app.example.com/dashboard")
  await handler(req, {} as any)
  expect(observed).toBeNull()
})

Impact Assessment

The operational impact of this vulnerability is critical for applications that use existence-based authorization checks. If the application server encounters a transient database outage or API timeout, the entire authentication wall is bypassed. This bypass allows unauthenticated external attackers to read sensitive records, perform modifications on administrative routes, and access private user dashboards.

The vulnerability does not affect environments utilizing rigid session schema validation post-authentication, as those systems would fail when attempting to access non-existent user properties on the parsed error object. However, applications relying solely on boolean checks such as if (session) are completely exposed during failure intervals.

Because this vulnerability occurs during server-side errors, the duration of exposure is tied directly to the duration of the server outage. In cases where a misconfigured provider is deployed permanently, the bypass remains accessible continuously, resulting in an indefinite authorization exposure across the affected deployment.

Remediation & Defensive Best Practices

The recommended remediation is to immediately update the next-auth dependency to version 5.0.0-beta.32 or higher. This update replaces the direct JSON parsing calls with the validated parseSessionResponse handler, preventing error objects from leaking into the authorization boundary.

If upgrading is not immediately feasible due to deployment freezes, developers should implement defensive checks in their middlewares or server components. Instead of checking truthiness via if (session), the session properties must be validated for structure. Checking for the absence of error keys or the presence of known user identifiers ensures a safe validation barrier.

// MANUAL WORKAROUND PATTERN
const session = await auth();
const isAuthenticated = session && !('message' in session) && session.user;
 
if (isAuthenticated) {
  // Allow transition
}

Additionally, verify that edge proxy configurations, web application firewalls, or load balancers do not normalize backend HTTP 500 JSON responses into HTTP 200 OK HTML error blocks. Such behavior would satisfy the client-side .ok check, potentially reintroducing the vulnerability if the response can be parsed as JSON.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.4/ 10

Affected Systems

Next.js applications using Auth.js / next-auth version 5 beta integrationsServer-side environments using next-auth middleware routes with existence checks

Affected Versions Detail

Product
Affected Versions
Fixed Version
next-auth
Auth.js
>= 5.0.0-beta.0, < 5.0.0-beta.325.0.0-beta.32
AttributeDetail
CWE IDCWE-636: Not Failing Closed
Attack VectorNetwork
CVSS v3.1 Score7.4 (High)
Impact TypeAuthentication Bypass
Exploit StatusProof-of-Concept / Functional
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1556Modify Authentication Process
Credential Access
T1110Brute Force / Auth Bypass
Credential Access
CWE-636
Not Failing Closed

The system does not fail to a secure state when an exception or configuration error occurs, resulting in a fail-open scenario where access is permitted rather than denied.

References & Sources

  • [1]GitHub Security Advisory GHSA-8fpg-xm3f-6cx3
  • [2]Release next-auth@5.0.0-beta.32

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•7 minutes ago•CVE-2026-59935
8.7

CVE-2026-59935: Infinite Loop Denial of Service in pypdf via Malformed Inline Images

An infinite loop vulnerability exists in the pypdf library prior to version 6.14.2 when processing malformed PDF inline images that utilize ASCII85 or ASCIIHex decoders. Attackers can exploit this vulnerability by submitting crafted PDF files containing incomplete streams, causing the parsing thread to consume 100% CPU resource indefinitely and leading to Denial of Service.

Amit Schendel
Amit Schendel
0 views•7 min read
•about 1 hour ago•CVE-2026-59937
7.5

CVE-2026-59937: CPU Exhaustion via Quadratic-Time Cross-Reference Recovery Loop in pypdf

A critical CPU exhaustion vulnerability exists in the pypdf library before version 6.14.0. When parsing PDF files with malformed or corrupt standard cross-reference (xref) table entries, the library falls back to sequentially scanning the entire file buffer via regular expression search. An attacker can exploit this algorithmic bottleneck by supplying a crafted PDF with numerous malformed xref entries, leading to denial of service.

Alon Barad
Alon Barad
2 views•4 min read
•about 4 hours ago•CVE-2026-6790
5.3

CVE-2026-6790: Host/Authority Header Desynchronization in Eclipse Jetty

A host/authority desynchronization vulnerability exists in Eclipse Jetty's handling of HTTP/2 and HTTP/3 requests. When both an ':authority' pseudo-header and a standard 'Host' header are present in a request, Jetty fails to validate that they represent the same target host. This desynchronization creates a host-confusion or 'split-brain' state, enabling attackers to bypass access control lists, escape virtual host isolation, poison web caches, or manipulate redirect targets in backend applications.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 5 hours ago•CVE-2026-8384
5.3

CVE-2026-8384: URI Path Parameter Parser State-Desynchronization Path Traversal in Eclipse Jetty

A path traversal vulnerability exists in Eclipse Jetty due to a state-desynchronization defect in the URI parsing state machine inside URIUtil.java. This defect allows unauthenticated remote attackers to bypass path-based security constraints enforced by downstream filters, application gateways, or authorization modules by crafting URIs with path parameter delimiters and parent directory traversal sequences.

Amit Schendel
Amit Schendel
5 views•7 min read
•about 6 hours ago•GHSA-WHVH-WF3X-G77J
0.0

GHSA-WHVH-WF3X-G77J: Improper Access Control and Listing Bypass in JupyterLab Extension Manager

An improper access control vulnerability in JupyterLab allows programmatic installation of blocked or non-allowed extensions. The vulnerability is caused by a missing await keyword when invoking the asynchronous checking method, leading Python to evaluate the returned coroutine object as truthy. Furthermore, the check lacks proper canonicalization of package names, enabling an attacker to bypass blocklists using casing or character variants.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 6 hours ago•CVE-2026-42980
7.8

CVE-2026-42980: Windows Kernel Local Privilege Escalation via WMI Integer Underflow

An unsigned 32-bit integer underflow vulnerability in the Windows Management Instrumentation (WMI) serialization subsystem of ntoskrnl.exe allows local authenticated users with low privileges to corrupt adjacent kernel pool allocations, execute arbitrary kernel-mode read and write operations, and perform a Token Swap attack to escalate their privileges to NT AUTHORITY\SYSTEM.

Amit Schendel
Amit Schendel
7 views•7 min read