CVE-2026-45669: Nuxt Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-fx6j-w5w5-h468
CVSS 5.4
CWE-83
Published
Advisory Summary

CVE-2026-45669 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-83: Improper Neutralization of Script in Attributes in a Web Page) affecting Nuxt libraries in the npm ecosystem. The issue involves reflected xss in `navigateto()` external redirect. Remediation is available by upgrading affected packages to version 3.21.6, 4.4.6.

CVE-2026-45669 at a Glance

CVE Identifier CVE-2026-45669
GHSA Identifier GHSA-fx6j-w5w5-h468
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-83: Improper Neutralization of Script in Attributes in a Web Page
Affected Product Nuxt
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-45669

To remediate this vulnerability, upgrade all affected Nuxt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nuxt fixed: 3.21.6
npm install nuxt@3.21.6
nuxt fixed: 4.4.6
npm install nuxt@4.4.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls nuxt

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-45669, inspect your project dependencies using npm:

npm ls nuxt

Analyze the terminal output to locate any version of Nuxt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.21.6), your application is affected.

Note: The npm ls nuxt command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-83: Improper Neutralization of Script in Attributes in a Web Page, where the product does not neutralize or incorrectly neutralizes "javascript:" or other uris from dangerous attributes within tags, such as onmouseover, onload, onerror, or style. In Nuxt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `navigateTo()` with `external: true` generates a server-side HTML redirect body containing a `<meta http-equiv="refresh">` tag. The destination URL is only sanitized by replacing `"` with `%22`, leaving `<`, `>`, `&`, and `'` unencoded. An attacker who can influence the URL passed to `navigateTo(url, { external: true })` can break out of the `content="…"` attribute and inject arbitrary HTML/JavaScript that executes under the application's origin. This is a different root cause from CVE-2024-34343 (GHSA-vf6r-87q4-2vjf), which addressed `javascript:` protocol bypass. The issue here is triggered by any valid URL containing `>`. ### Impact Applications that pass user-controlled input to `navigateTo(url, { external: true })` — typically via a `?next=` / `?redirect=` query parameter used for post-login or "return to" flows — are vulnerable to reflected cross-site scripting. The injected script runs in the context of the application's origin during the server-rendered redirect response, before the meta-refresh fires. ### Details In `packages/nuxt/src/app/composables/router.ts`, the SSR redirect path builds an HTML response body with only `"` percent-encoded in the destination URL: ```ts const encodedLoc = location.replace(/"/g, '%22') nuxtApp.ssrContext!['~renderResponse'] = { status: sanitizeStatusCode(options?.redirectCode || 302, 302), body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`, headers: { location: encodeURL(location, isExternalHost) }, } ``` The `Location` header is normalised through `encodeURL()` (which uses the `URL` constructor and correctly percent-encodes attribute-significant characters). The HTML body uses a narrower sanitiser. That mismatch is the root cause. ### Proof of concept Global middleware that forwards a query parameter to `navigateTo`: ```ts // middleware/redirect.global.ts export default defineNuxtRouteMiddleware((to) => { const next = to.query.next as string | undefined if (next) { return navigateTo(next, { external: true }) } }) ``` Request: ``` GET /?next=https://evil.example/x><img src=x onerror=alert(document.domain)> ``` Response body: ```html <!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=https://evil.example/x><img src=x onerror=alert(document.domain)>"></head></html> ``` The `>` after `evil.example/x` terminates the `content="…"` attribute, and the `<img onerror>` tag executes JavaScript in the application's origin before any redirect occurs. ### Patches Fixed in `nuxt@4.4.6` and `nuxt@3.21.6` by [#35052](https://github.com/nuxt/nuxt/pull/35052). The fix percent-encodes the full set of HTML-attribute-significant characters (`&`, `"`, `'`, `<`, `>`) before interpolating the URL into the meta-refresh body ### Workarounds If you can't upgrade immediately, validate user-controlled URLs before passing them to `navigateTo(url, { external: true })`. At minimum, normalise through `new URL(input).toString()` and reject inputs containing `<` or `>` (a normalised URL with these characters is malformed and safe to refuse).

CVE-2026-45669 Affected Nuxt Versions

2 component(s)
Fixed Versions:
3.21.64.4.6
Product / Package Ecosystem Affected Versions Fixed Version
nuxt
npm
≥ 3.4.3
< 3.21.6
3.21.6
nuxt
npm
≥ 4.0.0-alpha.1
< 4.4.6
4.4.6

References

Frequently Asked Questions

What is CVE-2026-45669?
CVE-2026-45669 is a security vulnerability in Nuxt involving Reflected XSS in `navigateTo()` external redirect under CWE-83: Improper Neutralization of Script in Attributes in a Web Page.
Which Nuxt versions are affected?
Affected versions include releases prior to 3.21.6, 4.4.6 across affected packages: nuxt.
What version fixes CVE-2026-45669?
Upgrading to 3.21.6, 4.4.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nuxt affected?
Yes, nuxt is affected in releases prior to 3.21.6, 4.4.6. Upgrade your dependency to 3.21.6, 4.4.6 or later.
What is the CVSS score of CVE-2026-45669?
CVE-2026-45669 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-45669?
CVE-2026-45669 is classified under CWE-83: Improper Neutralization of Script in Attributes in a Web Page (The product does not neutralize or incorrectly neutralizes "javascript:" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.).
How can I check npm dependencies for CVE-2026-45669?
Run the dependency tree command: 'npm ls nuxt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fx6j-w5w5-h468",
  "modified" : "2026-07-08T17:35:00Z",
  "published" : "2026-05-19T15:49:25Z",
  "aliases" : [ "CVE-2026-45669" ],
  "summary" : "Nuxt: Reflected XSS in `navigateTo()` external redirect",
  "details" : "### Summary\n`navigateTo()` with `external: true` generates a server-side HTML redirect body containing a `<meta http-equiv=\"refresh\">` tag. The destination URL is only sanitized by replacing `\"` with `%22`, leaving `<`, `>`, `&`, and `'` unencoded. An attacker who can influence the URL passed to `navigateTo(url, { external: true })` can break out of the `content=\"…\"` attribute and inject arbitrary HTML/JavaScript that executes under the application's origin.\n\nThis is a different root cause from CVE-2024-34343 (GHSA-vf6r-87q4-2vjf), which addressed `javascript:` protocol bypass. The issue here is triggered by any valid URL containing `>`.\n\n### Impact\nApplications that pass user-controlled input to `navigateTo(url, { external: true })` — typically via a `?next=` / `?redirect=` query parameter used for post-login or \"return to\" flows — are vulnerable to reflected cross-site scripting. The injected script runs in the context of the application's origin during the server-rendered redirect response, before the meta-refresh fires.\n\n### Details\nIn `packages/nuxt/src/app/composables/router.ts`, the SSR redirect path builds an HTML response body with only `\"` percent-encoded in the destination URL:\n\n```ts\nconst encodedLoc = location.replace(/\"/g, '%22')\nnuxtApp.ssrContext!['~renderResponse'] = {\nstatus: sanitizeStatusCode(options?.redirectCode || 302, 302),\nbody: `<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=${encodedLoc}\"></head></html>`,\nheaders: { location: encodeURL(location, isExternalHost) },\n}\n```\n\nThe `Location` header is normalised through `encodeURL()` (which uses the `URL` constructor and correctly percent-encodes attribute-significant characters). The HTML body uses a narrower sanitiser. That mismatch is the root cause.\n\n### Proof of concept\n\nGlobal middleware that forwards a query parameter to `navigateTo`:\n\n```ts\n// middleware/redirect.global.ts\nexport default defineNuxtRouteMiddleware((to) => {\nconst next = to.query.next as string | undefined\nif (next) {\n return navigateTo(next, { external: true })\n}\n})\n```\n\nRequest:\n\n```\nGET /?next=https://evil.example/x><img src=x onerror=alert(document.domain)>\n```\n\nResponse body:\n\n```html\n<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=https://evil.example/x><img src=x onerror=alert(document.domain)>\"></head></html>\n```\n\nThe `>` after `evil.example/x` terminates the `content=\"…\"` attribute, and the `<img onerror>` tag executes JavaScript in the application's origin before any redirect\noccurs.\n\n### Patches\nFixed in `nuxt@4.4.6` and `nuxt@3.21.6` by [#35052](https://github.com/nuxt/nuxt/pull/35052). The fix percent-encodes the full set of HTML-attribute-significant characters (`&`, `\"`, `'`, `<`, `>`) before interpolating the URL into the meta-refresh body\n\n### Workarounds\nIf you can't upgrade immediately, validate user-controlled URLs before passing them to `navigateTo(url, { external: true })`. At minimum, normalise through `new URL(input).toString()` and reject inputs containing `<` or `>` (a normalised URL with these characters is malformed and safe to refuse).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nuxt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.4.3"
      }, {
        "fixed" : "3.21.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.21.5"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nuxt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-alpha.1"
      }, {
        "fixed" : "4.4.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.4.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nuxt/nuxt/security/advisories/GHSA-fx6j-w5w5-h468"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45669"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nuxt/nuxt/pull/35052"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nuxt/nuxt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-83" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-19T15:49:25Z",
    "nvd_published_at" : "2026-06-12T14:16:31Z"
  }
}