Skip to content

GHSA-6gq8-jgmh-3ffp CVE-2026-114131

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

Medium npm
Severity
6.5 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.36%
Chance of exploitation in the next 30 days. Higher than 30.15% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-436 Interpretation Conflict
CWE-863 Incorrect Authorization
Fix
4.4.4
Upgrade nuxt to this version or later

Description

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:

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:

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

Affected versions

npm

PackageVulnerableFixed in
nuxt
>= 4.0.0, < 4.4.4
4.4.4
nuxt
>= 3.11.0, < 3.21.4
3.21.4

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

nuxt npm → 4.4.4

npm
npm install nuxt@4.4.4
yarn
yarn add nuxt@4.4.4
pnpm
pnpm add nuxt@4.4.4

Severity breakdown

CVSS 3.1 6.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

CWE-436: Interpretation Conflict

Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.

CWE-863: Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.

How to prevent it
  • Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-9v7c-q64q-vv33
Nuxt: Dot segments in the request path bypass `server/middleware` path checks and server route rules on page routes
Medium Also affects nuxt
GHSA-xfq5-w38q-pc2x
Nuxt server islands render `useHeadSafe` input without sanitisation
Medium Also affects nuxt
GHSA-vjh5-4x84-xrqp
Nuxt: Server-side route rules (`redirect`, `headers`, `proxy`, `ssr`) are skipped for case-variant paths when routing is case-insensitive
Medium Also affects nuxt
GHSA-jjm6-p2m9-9w4x
Nuxt: Incomplete fix for GHSA-934w-87qh-qr26: a `javascript:` URL prefixed with an ASCII control character executes from `<NuxtLink>` when `pages` is disabled
Low Also affects nuxt
GHSA-7c4v-fwgw-9rf7
Nuxt dev server discloses project root and workspace UUID via the Chrome DevTools workspace endpoint
Medium Also affects nuxt
GHSA-9pgf-384g-p7mv
Nuxt: Unauthenticated CPU exhaustion parsing and hashing the Nuxt island endpoint body before hash validation
High Also affects nuxt
GHSA-9473-5f9j-94wq
Nuxt: Server-Side Remote Code Execution via Runtime Template Injection in Nuxt Server Island Props
High Also affects nuxt
GHSA-48hr-524c-v5w3
Nuxt: Unauthorized Component Instantiation via Server Island Props
Medium Also affects nuxt
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor