Technical impact
The vulnerability arises when Next.js applications use NextResponse to set cookies on Edge runtime routes. The framework mistakenly exposes the internal x-middleware-set-cookie header in the public response, duplicating each cookie value and its attributes. Consequently, JavaScript code running on the same origin can read values that were intended to be HttpOnly, such as session identifiers. This results in an information disclosure of sensitive authentication data.
Affected Systems
The flaw affects the Vercel Next.js framework, specifically versions 15.x before 15.5.29 and 16.x before 16.4.5. Applications using App Router route handlers or Pages Router Edge API routes that set cookies via NextResponse are susceptible.
Risk and Exploitability
The CVSS score of 6.0 indicates a medium severity vulnerability. The EPSS score is not available, and the issue is not listed in the CISA KEV catalog, suggesting limited evidence of exploitation to date. Nonetheless, an attacker who can execute or inject JavaScript on the same origin can read the exposed HttpOnly cookie values, potentially compromising user sessions. The exploit requires interaction with the affected Edge route and does not rely on remote code execution, but the disclosure of session tokens can lead to credential theft or elevated privileges within the application.