Secrets
A failed server request can show your Nuxt app's secret token on the error page
Cataloged November 18, 2026 · Bolt · Cursor
Symptom
This applies to a Nuxt app, including a Nuxt app you build in Cursor or start in Bolt. If the app is not Nuxt, this card does not apply. Bolt has a Nuxt.js Starter template. Bolt's "Supported technologies" page says it supports JavaScript frameworks. GitHub Advisory GHSA-96x6-fvhx-49hg, CVE-2026-128075, is titled "Nuxt exposes the message and data of unhandled errors thrown during server rendering". It is rated Moderate. It was published to the GitHub Advisory Database on November 16, 2026. That advisory says that 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. The advisory's example is a page that runs await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). Anyone who can make the request fail, for example by requesting an id the upstream service rejects, receives the requested URL with the token and a 502 status, plus the upstream response body. The advisory says this happens regardless of what a custom error.vue renders, because the details are part of the payload. The same applies to any other error thrown during server rendering, such as a database driver error whose message names an internal host. The advisory says these are not affected: errors created deliberately with createError or showError, errors returned by useFetch and useAsyncData, which are part of the payload by design, and server routes in server/api. It says the affected versions are nuxt >= 4.0.0 < 4.6.4, and all of Nuxt 3 (nuxt >= 3.0.0 < 4.0.0). The fix is in nuxt@4.6.4. It says Nuxt 3 has reached end of life and will not receive a fix, so upgrade to Nuxt 4 or apply the workaround. The Nuxt v4.6.4 release notes, published November 2, 2026, say: "4.6.4 is a security release. It fixes eight advisories in Nuxt and pulls in nitropack 2.13.6". Behaviour change 1 on those notes, "Error details in production", says that when a page fails to render on the server, the error page and the payload now only carry message and data of errors you create with createError, and everything else is stripped.
Root cause
Nuxt treated an error thrown while rendering a page on the server as if the developer meant to show it, so the full message went into the page data sent to the browser. GitHub Advisory GHSA-96x6-fvhx-49hg says that 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 message is the URL that was requested, including its query string, and the data includes the body of the upstream error response. A token in that query string is part of the URL the browser receives. The advisory's example is await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). Anyone who can make the request fail, for example by requesting an id the upstream service rejects, receives the requested URL with the token and a 502 status, plus the upstream response body. The advisory says this happens regardless of what a custom error.vue renders, because the details are part of the payload. The same applies to any other error thrown during server rendering, such as a database driver error whose message names an internal host. The advisory says that after the fix in nuxt@4.6.4, the error page no longer shows the message of an error thrown with throw new Error(...) in production. It says to throw a createError with what the client may see instead. The Nuxt v4.6.4 release notes, behaviour change 1, "Error details in production", say that when a page fails to render on the server, the error page and the payload now only carry message and data of errors you create with createError, and everything else is stripped. The advisory's workaround is try { await $fetch(url) } catch (error) { throw createError({ statusCode: 502, statusMessage: 'Upstream request failed' }) }. The advisory also describes a Nitro plugin at server/plugins/hide-error-details.ts that hooks 'error' and, when error.cause is an Error that is not an h3 error, sets unhandled: true and data: undefined.
Before and after
The visitor sees a generic message. The URL and the token stay on the server. The before block is the example in GitHub Advisory GHSA-96x6-fvhx-49hg. A page awaits $fetch and lets the error bubble. The call is await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). The advisory says anyone who can make that request fail receives the requested URL with the token and a 502 status, plus the upstream response body, because those details are part of the error page payload. The after block sets nuxt to 4.6.4, the version the advisory names as the fix, and uses the advisory's workaround: try { await $fetch(url) } catch (error) { throw createError({ statusCode: 502, statusMessage: 'Upstream request failed' }) }. The after block keeps that users URL and sends useRuntimeConfig().usersToken on a header instead of in the query string. The header name in angle brackets is a placeholder. Sending the token on a header is general good practice. The advisory does not show a header. The statusMessage is the sentence in that workaround, so the client sees that sentence and not the URL. The Nuxt v4.6.4 release notes call this behaviour change "Error details in production". Those notes say that when a page fails to render on the server, the error page and the payload now only carry message and data of errors you create with createError, and everything else is stripped. If the app is still on Nuxt 3, the advisory says there is no patch. The try/catch is the workaround, and the version line is the Nuxt 4 fix.
Before
await $fetch(
`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`,
);After
"nuxt": "4.6.4"
try {
await $fetch(`http://users.internal/users/${route.params.id}`, {
headers: {
"<header-name>": useRuntimeConfig().usersToken,
},
});
} catch (error) {
throw createError({
statusCode: 502,
statusMessage: 'Upstream request failed',
});
}Fix prompt
In this project only. Do not scan or test anyone else's app. Do not open a deployed site you do not own. Do not print keys, tokens, passwords, request URLs that contain a secret, upstream response bodies, or environment variable values. When you mention a variable, print the name only. Do not run the failing page. Do not print error output.
1. This prompt applies if this project is a Nuxt app, including a Nuxt app you build in Cursor or start in Bolt. Bolt has a Nuxt.js Starter template. Bolt's "Supported technologies" page says it supports JavaScript frameworks. If this project is not Nuxt, say so and stop.
2. Read the nuxt version in this project's package.json. You may run npm ls nuxt in this project only. GitHub Advisory GHSA-96x6-fvhx-49hg says the affected versions are nuxt >= 4.0.0 < 4.6.4, and all of Nuxt 3 (nuxt >= 3.0.0 < 4.0.0). The fix is in nuxt@4.6.4. If this project is on Nuxt 4 and the version is below 4.6.4, upgrade the nuxt dependency to 4.6.4 or later. The Nuxt v4.6.4 release notes, published November 2, 2026, say: "4.6.4 is a security release. It fixes eight advisories in Nuxt and pulls in nitropack 2.13.6". Write the version you actually install. Do not guess a version that is not 4.6.4 and that you did not read from the package manager. Do not upgrade unrelated packages. If this project is on Nuxt 3, do not change the version in this step. The advisory says Nuxt 3 has reached end of life and will not receive a fix. Tell me to plan the move to Nuxt 4, and apply the workaround in the next steps now. Show me the package.json diff only if you change a Nuxt 4 version.
3. Search this project's pages, plugins, and route middleware for $fetch, and for a database client call that is not inside try/catch. The advisory says a page, plugin, or route middleware that throws an error that is not an HTTP error is the affected path. Give me each file and line. Do not print the URL or the token. The advisory says server routes in server/api are not affected. Do not edit those routes for this leak. The advisory says errors returned by useFetch and useAsyncData are part of the payload by design. Do not wrap those calls to strip that data. The advisory says errors created deliberately with createError or showError are not affected. Leave those calls, except where step 5 finds a secret in a URL.
4. Wrap each uncaught $fetch, and each uncaught database client call, in those pages, plugins, and route middleware. Rethrow with createError and a generic statusMessage. Do not pass the caught error's message, the requested URL, or the upstream body into createError. Do not set data to the raw error. The advisory's workaround is: try { await $fetch(url) } catch (error) { throw createError({ statusCode: 502, statusMessage: 'Upstream request failed' }) }. Use that statusCode and that statusMessage unless this project already has a client-safe statusMessage for that failure. The advisory says that after the fix, the error page no longer shows the message of an error thrown with throw new Error(...) in production, and that you throw a createError with what the client may see instead. Where a page, plugin, or route middleware uses throw new Error, replace it with createError when the client should see a status. Use a statusMessage that is safe for the client. Do not copy a message that names a host, a URL, a token, or a query string. Show me the diff.
5. Move any secret out of a request URL and into a header read from runtime config. The advisory's example reads the token with useRuntimeConfig().usersToken and places it in the query string: await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). The advisory says anyone who can make that request fail receives the requested URL with the token. Sending the token in a header instead of the query string is general good practice. The advisory does not show a header. Do not invent a runtimeConfig key. Use the key this project already has. If this project has no header name for that secret, stop on this step and ask me for the header name. Do not print the secret. Show me the diff only if you move a secret this project already sends.
6. The advisory also describes a Nitro plugin at server/plugins/hide-error-details.ts. It hooks 'error'. When error.cause is an Error that is not an h3 error, it sets unhandled: true and data: undefined. If this project cannot upgrade to nuxt@4.6.4 yet, copy that plugin from the advisory into this project. Do not write the plugin from this description. Do not invent hook fields. If you cannot open the advisory, say so and skip this step. The try/catch in step 4 is the workaround the advisory prints. Show me the diff only for a file you copied from the advisory.
7. Show me the diffs. Do not deploy. Do not request a URL. Tell me to open one page on my own deployed app with an id that the upstream service should reject, view the page source, and search the HTML for __NUXT_DATA__. The advisory says the message and data were sent in that payload. Tell me to confirm it does not contain an internal URL or a token. Do not open an app I do not own. If the payload still contains a secret, tell me the file and do not print the secret.
Do not print keys. Do not edit unrelated files.Paste this into the coding tool that has your own project open.
2-minute self-check
These steps are for an app you own. Do not run them against someone else's project.
- In your own project, run npm ls nuxt, or read the nuxt version in package.json. GitHub Advisory GHSA-96x6-fvhx-49hg says the affected versions are nuxt >= 4.0.0 < 4.6.4, and all of Nuxt 3 (nuxt >= 3.0.0 < 4.0.0). The fix is in nuxt@4.6.4. That advisory says Nuxt 3 has reached end of life and will not receive a fix. Do not run this in a project you do not own.
- In your own code, search for "?token=" and for "key=" inside $fetch URLs. Also search pages, plugins, and route middleware for throw new Error. The advisory's example puts the token in the query string: await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). The letters key= are the same kind of query secret. The advisory does not print them. It says that after the fix, the error page no longer shows the message of an error thrown with throw new Error(...) in production. Do not search a repository you do not own.
- On your own deployed app, open a page with an id the upstream service should reject. View the page source and search the HTML for __NUXT_DATA__. Confirm that payload does not contain an internal URL or a token. GitHub Advisory GHSA-96x6-fvhx-49hg says the message and data were sent in that payload, regardless of what a custom error.vue renders. Do not open an app you do not own, and do not paste a token.
Common questions
My custom error page only shows "Something went wrong". Am I safe?
No. GitHub Advisory GHSA-96x6-fvhx-49hg says the message and data are sent to the client in the error page payload (__NUXT_DATA__) and in JSON error responses. It says this happens regardless of what a custom error.vue renders, because the details are part of the payload. The advisory does not publish the words "Something went wrong". For a failed $fetch, the payload holds the URL that was requested, including its query string, and the body of the upstream error response. The advisory's example is await $fetch(`http://users.internal/users/${route.params.id}?token=${useRuntimeConfig().usersToken}`). Anyone who can make that request fail receives the requested URL with the token and a 502 status, plus the upstream response body.
Are my server/api routes affected?
GitHub Advisory GHSA-96x6-fvhx-49hg says server routes (server/api) are not affected. It says errors returned by useFetch and useAsyncData are part of the payload by design. It says errors created deliberately with createError or showError are not affected. The affected path is a page, a plugin, or route middleware that throws an error that is not an HTTP error. Nuxt wraps that error with createError, and the wrapped error was treated as one the app raised deliberately, so in production its message and data were sent to the client.
I'm on Nuxt 3. Is there a patch?
No. GitHub Advisory GHSA-96x6-fvhx-49hg says Nuxt 3 has reached end of life and will not receive a fix. It says the affected Nuxt 3 range is nuxt >= 3.0.0 < 4.0.0. The fix is in nuxt@4.6.4. The advisory says to upgrade to Nuxt 4 or apply the workaround. The workaround it prints is try { await $fetch(url) } catch (error) { throw createError({ statusCode: 502, statusMessage: 'Upstream request failed' }) }. The Nuxt v4.6.4 release notes, published November 2, 2026, say: "4.6.4 is a security release. It fixes eight advisories in Nuxt and pulls in nitropack 2.13.6".