Next.js patches HttpOnly cookie exposure flaw in Edge runtime routes

  • Next.js
  • cookie
  • Edge

Vulnerability affected versions 15.0.0 through 15.5.28 and 16.0.0 through 16.4.4

Developers should update to version 15.5.29 or 16.4.5 to mitigate security risks

Next.js patched a vulnerability that exposed HttpOnly cookies through an internal response header on routes running in its Edge runtime. The original advisory does not specify when the fix was released.

The vulnerability affected Next.js versions 15.0.0 through 15.5.28 and 16.0.0 through 16.4.4. HttpOnly cookies are intended to be inaccessible to client-side scripts; the issue involved their exposure through an internal response header on Edge runtime routes.

Next.js fixed the issue in versions 15.5.29 and 16.4.5. The advisory identifies the affected and patched versions but gives no further details about the vulnerability’s scope or exploitation.

Key terms explained

HttpOnly

HttpOnly is a security attribute added to cookies to prevent them from being accessed by client-side scripts. This helps protect sensitive data like session identifiers from being stolen by malicious scripts.

Think of it this way. It is like putting a lock on a diary so that only the owner can open it, preventing anyone else who picks it up from reading the pages.

Edge runtime

The Edge Runtime is a server environment in Next.js that provides a restricted set of APIs for executing code. It is designed for high-performance tasks and specific routing capabilities.

Next.js

Next.js is a framework built on React that simplifies the development of full-stack web applications. It manages low-level configurations like bundling and compilation to help developers build products more efficiently.