GHSA-F3X9-2CHM-73C8

Vulnerability from github – Published: 2026-11-16 14:59 – Updated: 2026-11-16 14:59
VLAI
Summary
Nuxt: Incomplete fix for GHSA-6gq8-jgmh-3ffp: an encoded slash (`%2F`) in the request path bypasses route rules on catch-all page routes
Details

Summary

Nuxt matches route rules against the request path with encoded slashes (%2F) left encoded, while the page router decodes them into route params. A request that spells a slash as %2F can therefore render a page through a catch-all route without the route rules configured for the path it resolves to. The fix for GHSA-6gq8-jgmh-3ffp deliberately left reserved escapes such as %2F encoded, so it did not cover this form.

Impact

An unauthenticated attacker can bypass route rules that protect paths served by a catch-all page route, or by a custom route whose param can span several segments.

export default defineNuxtConfig({
  routeRules: {
    '/docs/internal/**': { appMiddleware: 'auth', headers: { 'X-Frame-Options': 'DENY' } },
    '/admin/**': { redirect: '/login' },
  },
})

With app/pages/docs/[...slug].vue, /docs/internal/guide runs auth, but /docs/internal%2Fguide renders the same page without running auth and without the header. With a root app/pages/[...slug].vue, /admin%2Fsecret is rendered instead of redirected.

The rules skipped include server-side redirect, headers, proxy, ssr and noScripts, and appMiddleware, appLayout and redirect as matched in the app during server rendering and client navigation. getRouteRules returns the same incomplete result.

Whether the page then shows protected content depends on how it reads the route:

  • With a route such as definePageMeta({ path: '/docs/:path(.*)' }), route.params.path is internal/guide for both requests.
  • With a repeatable catch-all ([...slug].vue), route.params.slug is ['internal/guide'] instead of ['internal', 'guide'], so a page that joins the segments (slug.join('/')) to load content loads the protected resource.
  • route.path keeps the encoding (/docs/internal%2Fguide), so a page that loads content by route.path does not resolve it.

Not affected:

  • Static page routes and params that match a single segment. /docs%2Finternal does not match app/pages/docs/internal.vue.
  • API handlers in server/api and server/routes. As far as we can tell, Nitro matches these against the same path as its route rules, so a handler and the rules for it agree.

Browsers send %2F in a path as written, so a plain link is enough to reach the page.

Patches

Fixed in nuxt@4.6.4, together with @nuxt/nitro-server@4.6.4 and @nuxt/vite-server@4.6.4, which it depends on. Route rules are now resolved for both the request path and the path with each %2F read as a separator, and the rules matched by either apply. Nuxt 3 has reached end of life and will not receive a fix.

Workarounds

Reject page requests whose path contains an encoded slash in a server middleware:

// server/middleware/encoded-slash.ts
export default defineEventHandler((event) => {
  if (/%2f/i.test(event.path.split('?')[0])) {
    throw createError({ statusCode: 404 })
  }
})

This also rejects legitimate uses, such as an API route that takes a scoped package name (@scope%2Fname) as a param; narrow the check to the path prefixes your route rules protect if you need those.

A reverse proxy or CDN that rejects or decodes encoded slashes before forwarding the request also removes the mismatch.

Credits

Thanks to Riahi Foudhil for reporting this issue.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "nuxt"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0"
            },
            {
              "fixed": "4.6.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c 4.0.0"
      },
      "package": {
        "ecosystem": "npm",
        "name": "nuxt"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@nuxt/nitro-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.2.0"
            },
            {
              "fixed": "4.6.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c 4.0.0"
      },
      "package": {
        "ecosystem": "npm",
        "name": "@nuxt/nitro-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.20.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@nuxt/vite-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.6.0"
            },
            {
              "fixed": "4.6.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-128071"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-436",
      "CWE-863"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-16T14:59:45Z",
    "nvd_published_at": "2026-11-13T18:17:35Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\n\nNuxt matches route rules against the request path with encoded slashes (`%2F`) left encoded, while the page router decodes them into route params. A request that spells a slash as `%2F` can therefore render a page through a catch-all route without the route rules configured for the path it resolves to. The fix for [GHSA-6gq8-jgmh-3ffp](https://github.com/nuxt/nuxt/security/advisories/GHSA-6gq8-jgmh-3ffp) deliberately left reserved escapes such as `%2F` encoded, so it did not cover this form.\n\n### Impact\n\nAn unauthenticated attacker can bypass route rules that protect paths served by a catch-all page route, or by a custom route whose param can span several segments.\n\n```ts\nexport default defineNuxtConfig({\n  routeRules: {\n    \u0027/docs/internal/**\u0027: { appMiddleware: \u0027auth\u0027, headers: { \u0027X-Frame-Options\u0027: \u0027DENY\u0027 } },\n    \u0027/admin/**\u0027: { redirect: \u0027/login\u0027 },\n  },\n})\n```\n\nWith `app/pages/docs/[...slug].vue`, `/docs/internal/guide` runs `auth`, but `/docs/internal%2Fguide` renders the same page without running `auth` and without the header. With a root `app/pages/[...slug].vue`, `/admin%2Fsecret` is rendered instead of redirected.\n\nThe rules skipped include server-side `redirect`, `headers`, `proxy`, `ssr` and `noScripts`, and `appMiddleware`, `appLayout` and `redirect` as matched in the app during server rendering and client navigation. `getRouteRules` returns the same incomplete result.\n\nWhether the page then shows protected content depends on how it reads the route:\n\n- With a route such as `definePageMeta({ path: \u0027/docs/:path(.*)\u0027 })`, `route.params.path` is `internal/guide` for both requests.\n- With a repeatable catch-all (`[...slug].vue`), `route.params.slug` is `[\u0027internal/guide\u0027]` instead of `[\u0027internal\u0027, \u0027guide\u0027]`, so a page that joins the segments (`slug.join(\u0027/\u0027)`) to load content loads the protected resource.\n- `route.path` keeps the encoding (`/docs/internal%2Fguide`), so a page that loads content by `route.path` does not resolve it.\n\nNot affected:\n\n- Static page routes and params that match a single segment. `/docs%2Finternal` does not match `app/pages/docs/internal.vue`.\n- API handlers in `server/api` and `server/routes`. As far as we can tell, Nitro matches these against the same path as its route rules, so a handler and the rules for it agree.\n\nBrowsers send `%2F` in a path as written, so a plain link is enough to reach the page.\n\n### Patches\n\nFixed in `nuxt@4.6.4`, together with `@nuxt/nitro-server@4.6.4` and `@nuxt/vite-server@4.6.4`, which it depends on. Route rules are now resolved for both the request path and the path with each `%2F` read as a separator, and the rules matched by either apply. Nuxt 3 has reached end of life and will not receive a fix.\n\n### Workarounds\n\nReject page requests whose path contains an encoded slash in a server middleware:\n\n```ts\n// server/middleware/encoded-slash.ts\nexport default defineEventHandler((event) =\u003e {\n  if (/%2f/i.test(event.path.split(\u0027?\u0027)[0])) {\n    throw createError({ statusCode: 404 })\n  }\n})\n```\n\nThis also rejects legitimate uses, such as an API route that takes a scoped package name (`@scope%2Fname`) as a param; narrow the check to the path prefixes your route rules protect if you need those.\n\nA reverse proxy or CDN that rejects or decodes encoded slashes before forwarding the request also removes the mismatch.\n\n### Credits\n\nThanks to Riahi Foudhil for reporting this issue.",
  "id": "GHSA-f3x9-2chm-73c8",
  "modified": "2026-11-16T14:59:45Z",
  "published": "2026-11-16T14:59:45Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/nuxt/nuxt/security/advisories/GHSA-f3x9-2chm-73c8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-128071"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nuxt/nuxt/commit/084396b101e3b4d3545e86ff80dc313496bc87c0"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/nuxt/nuxt"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nuxt/nuxt/releases/tag/v4.6.4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Nuxt: Incomplete fix for GHSA-6gq8-jgmh-3ffp: an encoded slash (`%2F`) in the request path bypasses route rules on catch-all page routes"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…