Nuxt 4.6.4 Closes 11 Advisories and Changes Five Defaults
Nuxt's maintainers tagged 4.6.4 on November 2 and described it in one line: it is a security release, and they recommend upgrading as soon as you can. That line is the whole headline. The detail worth your time is the li
Nuxt's maintainers tagged 4.6.4 on November 2 and described it in one line: it is a security release, and they recommend upgrading as soon as you can. That line is the whole headline. The detail worth your time is the list of five behaviour changes underneath, because security fixes that change defaults are the ones that break a Friday deploy.
I'm going to go through those five in order of how likely they are to hit a real app, then give you a short upgrade routine. I haven't run the release myself; everything below comes from the GitHub release notes and the commit list attached to them.
The count: 8 plus 3
The release notes say 4.6.4 fixes eight advisories in Nuxt and pulls in nitropack 2.13.6, which fixes three more in Nitro. That is where the 11 in the headline comes from. The notes don't list the advisory IDs inline, so if your security team needs them for a ticket, open the repository's Security tab and match them to the commits. The Nuxt release page links the changelog compare for exactly that.
Expand
Nuxt logo, green and dark blue wordmark
Image: Nuxt via Wikimedia Commons, Public domain
Several of the fix commits give away the shape of the problems. There's one that stops exposing details of untrusted thrown errors, one that makes wildcard redirect tails resolve from the matched segments, one that keeps a leading double slash in the renderer request path, one about trusting x-forwarded-proto only when it's opted in, and one that strips trailing slashes in linear time. The notes give no exploit details, and I won't guess at them; the titles alone show these are request-handling and error-exposure fixes.
1. Production errors lose their extra fields
This is the one most likely to bite. When a page fails to render on the server, the error page and the payload now carry only message and data of errors you create with createError. Everything else is stripped.
If you've been leaning on a stack trace, a status text, or a custom property on an error to render something helpful for users, that's gone in production. The fix is boring and good: put anything the UI needs into the data object when you call createError, and keep your own diagnostics in server logs where users can't read them. Grep your codebase for error. property reads inside error.vue and your error pages before you upgrade.
The notes also include a documentation change that warns against spreading untrusted objects onto server components. It's a docs line, not a behaviour change, but it points at the same theme: data you didn't write shouldn't flow straight into props.
2. Webpack and rspack dev servers check the Host header
Vite dev servers already reject requests with an unexpected Host header. Webpack and rspack now do the same. The new option is devServer.allowedHosts, added to the schema across the nitro and vite packages in the commit list.
Who this affects: anyone testing through a tunnel, a custom local domain, a container hostname, or a shared dev URL. After the upgrade you'll see requests refused. Add your hostname to devServer.allowedHosts in nuxt.config.ts, restart the dev server, and move on. Don't open it up with a wildcard just to make the error go away. The check exists because a dev server that answers to any hostname can be reached by a page on another origin that points a DNS name at your machine.
3. workspaceDir detection gets stricter
When workspaceDir isn't set, Nuxt now only widens it beyond rootDir to an explicit workspace root or the closest git repository. Monorepos with an unusual layout may notice that files outside the detected directory stop being picked up. If your repo has the Nuxt app three folders deep under a root with no workspace file, set workspaceDir explicitly and the question goes away.
4. Cached routes cache less
For nitropack, cache, swr and isr route rules now cache only GET and HEAD requests. They also stop storing responses that set a cookie or send Cache-Control: private or no-store. Wildcard proxy and redirect rules reject requests whose resolved target would leave the rule's scope.
This is the quiet one. If you rely on an swr rule for a page that sets a session cookie, the response is no longer cached, and your origin will see more traffic than before. That's the intended result, because caching a response that carried a Set-Cookie header is how one visitor's session ends up in another visitor's browser. Check your route rules for any cached path that also sets cookies, and decide whether the cookie belongs on that route at all.
5. Encoded slashes match route rules
Route rules now match paths that contain encoded slashes, so a request for /api%2Fadmin is covered by a /api/** rule. Before, a rule written to protect /api/** could be sidestepped with an encoded path. If you've put authorisation or caching behind a route rule, it now applies to those variants too. Test one admin-style path with %2F after the upgrade and confirm you get the response you expect.
The commit list also contains a fix to preserve wildcard tails in case-insensitive route rules, which is the same family of problem.
An upgrade routine that takes under an hour
Do it in this order, and stop if any step surprises you.
- Bump
nuxtto 4.6.4 and let it pullnitropack2.13.6. Check your lockfile shows that Nitro version, since the release requires it. - Run your test suite and a production build. Fix anything that reads extra fields from errors.
- Start the dev server through whatever hostname your team uses. If it refuses, add that host to
devServer.allowedHosts. - Hit three routes: one cached with
swr, one behind a route rule that guards something, and one that throws on purpose withcreateError. Confirm the output matches what you want users to see. - Deploy to staging and watch origin traffic for an hour. A jump on routes that set cookies is the cache change doing its job.
For a monorepo, add a sixth step: set workspaceDir explicitly if you didn't, then confirm shared packages still resolve.
Other fixes in the same tag
The rest of the release is ordinary maintenance. It requires unrouting 0.3.2, uses unambiguous encoding for island hashes, avoids hoisting setup-only values from definePageMeta, and makes emitted tsconfig and types stable across reruns. There are also fixes to dev CSS ordering and a note that the release was cut from the main branch with GitHub's immutable release flag, so only the title and notes can be edited afterwards.
Nuxt users on older minors have a decision to make. The release notes don't say which earlier versions are affected, and they only describe 4.6.4. If you're on 4.6.x, upgrade. If you're on something older, check the security advisories on the repository before assuming a backport exists.
What I'd do this week
If you ship a public Nuxt app, schedule the upgrade this week, test the five changes above, and note the date in your release log. If you run Nuxt only internally, you have more room, but the Host header change is a reason to do it before a new teammate sets up a tunnel and loses an afternoon.
Expand
Nuxt wordmark logo in black, 2023 design
Image: NuxtLabs via Wikimedia Commons, CC BY-SA 4.0
Two questions the notes leave open
Does the error change affect development? The notes talk about production error pages and payloads, so dev output should keep its detail, but confirm in your own app.
Is there a Next.js angle? A separate roundup mentioned that Next.js was preparing its own security release for the following day. We have no details on it, so don't treat this Nuxt upgrade as covering anything on that side.
Originally published on Mango Developer.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.
