The vulnerability exists due to a combination of two flaws in how Nuxt handles server-side rendered 'island' pages. When a request for a page island (e.g., /__nuxt_island/page_secret) was received, two things went wrong:
-
In packages/nuxt/src/pages/runtime/plugins/router.ts, the router plugin would detect that it was rendering an island (ssrContext.islandContext was set) and would intentionally skip executing any route middleware associated with the page. This was the primary bypass, as it prevented authentication and authorization checks from running.
-
In packages/nitro-server/src/runtime/handlers/island.ts, the request handler was designed to only render the component's HTML. It lacked the logic to inspect the server context for a response generated by middleware (such as a redirect to a login page). This meant that even if the first flaw was fixed and middleware did run, this handler would have ignored the middleware's decision and returned the page content, nullifying the security check.
The patch addresses both issues. It modifies the router plugin to specifically identify and run middleware for page-level islands. It also updates the island request handler to check for and honor any responses set by middleware, ensuring that redirects and errors are correctly propagated to the client.