---
id: "CVE-2026-114131"
kind: "vulnerability"
aliases: ["CVE-2026-114131", "GHSA-6gq8-jgmh-3ffp"]
title: "Nuxt: Route rules are matched against the raw request path, so a percent-encoded segment can bypass `appMiddleware` on dynamic and catch-all routes"
severity: "medium"
cvss: 6.5
epss: 0.0028899998869746923
exploited: false
status: "open"
category: "package"
products: [{"name": "nuxt", "fixed": ["4.4.4"], "affected": ">= 4.0.0, < 4.4.4", "ecosystem": "npm"}, {"name": "nuxt", "fixed": ["3.21.4"], "affected": ">= 3.11.0, < 3.21.4", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-436", "cwe-863", "npm", "nuxt", "package", "self-hosted", "ssr"]
not_affected_if: ["auth-enforced-elsewhere", "managed-hosting", "static-ascii-routes", "static-export"]
published_at: "2026-10-21T18:17:25+00:00"
first_seen_at: "2026-10-23T19:11:31+00:00"
updated_at: "2026-10-23T21:57:29+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-6gq8-jgmh-3ffp", "first_seen_at": "2026-10-23T19:11:31+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114131", "first_seen_at": "2026-10-23T21:57:29+00:00"}]
---

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

Nuxt matches routeRules keys against the raw, undecoded request path while the router decodes it, so a percent-encoded request like /users/%61dmin can render a dynamic page while skipping the routeRules appMiddleware meant to protect it. An unauthenticated attacker can therefore reach gated pages rendered by the server.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:nuxt affected >= 4.0.0, < 4.4.4 fixed 4.4.4
- npm:nuxt affected >= 3.11.0, < 3.21.4 fixed 3.21.4

## How to check

Check the nuxt version in package.json or the lockfile: npm ls nuxt
If you use routeRules with appMiddleware on dynamic or catch-all routes, request a percent-encoded variant of the protected path (for example /users/%61dmin) without a session and see whether the page renders.

## Fix

Upgrade nuxt to 4.4.4 or later on the 4.x line, or 3.21.4 or later on the 3.x line; the sources recommend 4.5.2 or 3.21.11 for the comparison fix itself.
As a workaround, attach middleware to the page with definePageMeta({ middleware: 'auth' }) instead of relying on a routeRules key alone.

## Timeline

- 2026-10-23T19:11:31+00:00 ghsa https://github.com/advisories/GHSA-6gq8-jgmh-3ffp
- 2026-10-23T21:57:29+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-114131

## From the sources

### 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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
