Media

Nuxt: Route rules are matched against the raw request path, so a percent-encoded segment can bypass `appMiddleware` on dynamic and catch-all routes

  • Publicada: 22.10.2026
  • Actualizado: 22.10.2026 20:17

Summary

Nuxt compared routeRules keys against the raw request path, without decoding percent-encoding, while the router decodes parameters when it resolves a route. A request whose path is percent-encoded can therefore resolve to a page while failing to match the route rule meant to protect it, so the rule's appMiddleware never runs, including during server rendering.

Impact

For a page served through a dynamic or catch-all route, an attacker can percent-encode a character in the path to skip the rule:

ts
export default defineNuxtConfig({
  routeRules: {
    '/users/admin': { appMiddleware: 'auth' },
  },
})

Requesting /users/%61dmin still renders app/pages/users/[id].vue with id decoded to admin, but the rule keyed /users/admin does not match, so auth does not run and the server renders and returns the gated page to an unauthenticated visitor. No privileges and no user interaction are required, and only ASCII characters are involved.

Purely static ASCII routes are not affected: static segments are matched without decoding, so a request for /%61dmin does not resolve to the page registered at /admin and 404s instead of rendering.

The rule keys affected are the ones carried in the app manifest and consumed by the app: appMiddleware, redirect, appLayout, ssr, prerender, and the payload flags derived from cache, isr and swr.

If you have pinned or overridden dependency versions below what your Nuxt release declares, a release outside the affected ranges can still be exposed, so do not conclude from a single reproduction that you are unaffected.

Patches

Releases from 4.4.4 and 3.21.4 are not affected, because their dependency floor requires a version of the underlying HTTP layer that normalises percent-encoding in the request path before routing, which removes the mismatch in a default install.

The comparison itself is fixed in nuxt@4.5.2 and nuxt@3.21.11: route-rule keys and lookup paths are now decoded (and, unless router.options.sensitive is set, case-folded) before they are compared. Reserved escapes such as %2F are left encoded, so decoding cannot introduce extra path segments, and paths that cannot be decoded are matched verbatim. Upgrading to those releases is recommended, since it fixes the comparison rather than relying on a dependency to normalise the input, and it also restores route rules for pages whose paths contain non-ASCII characters.

Workarounds

If you cannot upgrade, do not rely on a routeRules key alone to protect a route. Attach the middleware to the page itself, which binds it to the resolved route rather than to the raw path string:

vue
<script setup lang="ts">
definePageMeta({ middleware: 'auth' })
</script>

Credits

Thanks to @sushi-gif, whose report that route rules keyed with non-ASCII paths never match the routes generated for those pages prompted the review that found this issue.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm nuxt >= 4.0.0, < 4.4.4, >= 3.11.0, < 3.21.4 4.4.4, 3.21.4

Referencias

Puntuación CVSS 6.5/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Debilidad (CWE)
CWE-436, CWE-863
Plataforma
npm
Paquete
nuxt
Publicada
22.10.2026
Actualizado
22.10.2026 20:17

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-6gq8-jgmh-3ffp - CC BY 4.0

Historial de vulnerabilidades: nuxt

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (25) en el archivo
Entradas en total
25
Primera → última
06.2023 10.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 2
  • Alta 7
  • Media 11
  • Baja 5

Divulgaciones por año

  1. 2023: 1
  2. 2024: 2
  3. 2025: 2
  4. 2026: 20
Gravedad:
  1. Nuxt: Route rules are matched against the raw request path, so a percent-encoded segment can bypass `appMiddleware` on dynamic and catch-all routes esta entrada
    Media · 6.5 CVE-2026-114131 >= 4.0.0, < 4.4.4, >= 3.11.0, < 3.21.4 4.4.4, 3.21.4
  2. Alta · 7.5 CVE-2026-71321 >= 4.0.0, < 4.5.1, >= 3.1.0, < 3.21.10 4.5.1, 3.21.10
  3. Alta · 8.1 CVE-2026-71320 >= 4.0.0, < 4.5.1, >= 3.4.0, < 3.21.10 4.5.1, 3.21.10
  4. Alta · 8.2 CVE-2026-71315 >= 4.4.7, < 4.5.1, >= 3.21.7, < 3.21.10 4.5.1, 3.21.10
  5. Alta · 7.5 CVE-2026-71314 >= 4.0.0, < 4.5.1, >= 3.1.0, < 3.21.10 4.5.1, 3.21.10
  6. Alta CVE-2026-53721 >= 4.0.0, < 4.4.7, >= 3.11.0, < 3.21.7 4.4.7, 3.21.7
  7. Alta · 7.5 CVE-2025-27415 >= 3.0.0, < 3.16.0 3.16.0
  8. Crítica · 8.8 CVE-2024-34344 >= 3.4.0, < 3.12.4 3.12.4
  9. Crítica · 8.1 CVE-2023-3224 >= 3.4.0, < 3.4.3 3.4.3

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.