Medium

Nuxt exposes the message and data of unhandled errors thrown during server rendering

  • Disclosed: 16.11.2026
  • Updated: 16.11.2026 17:17

Summary

When a page, plugin or route middleware throws an error that is not an HTTP error, Nuxt wraps it with createError before rendering the error page. The wrapped error was treated as one the app raised deliberately, so in production its message and data were sent to the client in the error page payload (__NUXT_DATA__) and in JSON error responses. For a failed $fetch, that is the URL that was requested (including its query string) and the body of the upstream error response.

Impact

An application is affected if server-rendered code lets an error with sensitive details reach the error page, for example:

vue
<script setup lang="ts">
const route = useRoute()
// the upstream error body, and the token in the URL, reach the client if this request fails
await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`)
</script>

Anyone who can make the request fail (for example by requesting an id the upstream service rejects) receives [GET] "http://users.internal/users/1?token=...": 502 and the upstream response body. This happens regardless of what a custom error.vue renders, because the details are part of the payload. With the default configuration, the HTTP status line is not affected.

The same applies to any other error thrown during server rendering, such as a database driver error whose message names an internal host.

Errors created deliberately with createError (or showError) are not affected: their message and data are meant for the client. Errors returned by useFetch and useAsyncData are also unchanged, as they are part of the payload by design. Server routes (server/api) are not affected.

Patches

Fixed in nuxt@4.6.4. Nuxt now marks any thrown value that is not already an HTTP error as unhandled, so the error page and JSON responses receive its status and a generic message. As a result, the error page no longer shows the message of an error thrown with throw new Error(...) in production; throw a createError with what the client may see instead.

Nuxt 3 has reached end of life and will not receive a fix. Upgrade to Nuxt 4, or apply the workaround below.

Workarounds

Catch errors from server-side requests and rethrow them with only the details the client may see:

ts
try {
  await $fetch(url)
} catch (error) {
  throw createError({ statusCode: 502, statusMessage: 'Upstream request failed' })
}

Alternatively, add a Nitro plugin that hides the details of errors Nuxt wrapped. This also hides the details of a createError called with an Error (or with a cause):

ts
// server/plugins/hide-error-details.ts
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('error', (error) => {
    const cause = (error as { cause?: unknown }).cause
    if (cause instanceof Error && !(cause.constructor as { __h3_error__?: boolean }).__h3_error__) {
      Object.assign(error, { unhandled: true, data: undefined })
    }
  })
})

If secrets such as tokens in upstream URLs may have been exposed this way, rotate them.

Credits

Thanks to abhijit_dave for reporting this through the Vercel HackerOne program.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package nuxt >= 4.0.0, < 4.6.4, >= 3.0.0 4.6.4

References

CVSS score 5.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness (CWE)
CWE-209
Platform
npm
Package
nuxt
Disclosed
16.11.2026
Updated
16.11.2026 17:17

Sources and licenses

OSV / GitHub Advisory Database - GHSA-96x6-fvhx-49hg - CC BY 4.0

Vulnerability history: nuxt

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (30) in the archive
Total entries
30
First → latest
06.2023 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 7
  • Medium 15
  • Low 6

Disclosures per year

  1. 2023: 1
  2. 2024: 2
  3. 2025: 2
  4. 2026: 25
Severity:
  1. Nuxt exposes the message and data of unhandled errors thrown during server rendering this entry
    Medium · 5.3 CVE-2026-128075 >= 4.0.0, < 4.6.4, >= 3.0.0 4.6.4
  2. High · 7.5 CVE-2026-71321 >= 4.0.0, < 4.5.1, >= 3.1.0, < 3.21.10 4.5.1, 3.21.10
  3. High · 8.1 CVE-2026-71320 >= 4.0.0, < 4.5.1, >= 3.4.0, < 3.21.10 4.5.1, 3.21.10
  4. High · 8.2 CVE-2026-71315 >= 4.4.7, < 4.5.1, >= 3.21.7, < 3.21.10 4.5.1, 3.21.10
  5. High · 7.5 CVE-2026-71314 >= 4.0.0, < 4.5.1, >= 3.1.0, < 3.21.10 4.5.1, 3.21.10
  6. High CVE-2026-53721 >= 4.0.0, < 4.4.7, >= 3.11.0, < 3.21.7 4.4.7, 3.21.7
  7. High · 7.5 CVE-2025-27415 >= 3.0.0, < 3.16.0 3.16.0
  8. Critical · 8.8 CVE-2024-34344 >= 3.4.0, < 3.12.4 3.12.4
  9. Critical · 8.1 CVE-2023-3224 >= 3.4.0, < 3.4.3 3.4.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.