Nuxt route rule bypass via encoded slashes
nuxt · @nuxt nitro-server · @nuxt vite-server
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| nuxt npm |
|
|
| @nuxt/nitro-server npm |
|
|
nuxt · @nuxt nitro-server · @nuxt vite-server
| Product | Affected | Fixed in |
|---|---|---|
| nuxt npm |
|
|
| @nuxt/nitro-server npm |
|
|
| @nuxt/vite-server npm |
|
|
Nuxt is an open-source web development framework for Vue.js. Nuxt from 3.0.0 until 4.6.4, @nuxt/nitro-server from 3.20.0 until 4.6.4, and @nuxt/vite-server from 4.6.0 until 4.6.4, routeRules matching leaves an encoded slash (%2F) in the request path while a catch-all page such as app/pages/[...slug].vue or a custom multi-segment page route decodes it into a route parameter. The getRouteRules result is therefore incomplete, and an unauthenticated request can render the page without the redirect, headers, proxy, SSR, noScripts, appMiddleware, or appLayout rules configured for the decoded path. Protected content is resolved only when the page interprets the decoded parameter accordingly: a custom multi-segment parameter can contain the decoded path, while a repeatable catch-all must join the slash-containing array element; route.path remains encoded and does not resolve that resource. Static pages, single-segment parameters, server/api handlers, and server/routes handlers are not affected because they do not have the same encoded-path mismatch. This issue is fixed in version 4.6.4.
From the CVE record · GitHub_M
In affected Nuxt packages, route-rule matching leaves an encoded slash in the request path while certain multi-segment page routes decode it. An unauthenticated network request can render a page without rules configured for the decoded path, but protected content is exposed only if the page uses the decoded parameter to resolve it. No user interaction is required.
Check applications running npm nuxt >=3.0.0, @nuxt/nitro-server >=3.20.0, or @nuxt/vite-server >=4.6.0 on versions before 4.6.4.