Repository navigation
fix(nuxt): Filter the query string in server error events - #26919
Merged
Merged
Conversation
The Nitro error hook named the error event after the raw request path. On Nitro v2 the path has the query string, so the transaction name and the `nuxt` context of the event could hold secrets from the URL, for example `GET /api/user?auth=...`. The hook also set the name on the current scope, where it stayed for every later event of that scope. The name now applies only to the captured error.
Contributor
size-limit report 📦Compared: c1356f8 (PR test merge using develop at a159856) Against: a159856 (develop) · base run #68059 ✅ Baseline matches: this diff contains only this PR's changes.
|
…oving it The query string is collected by default, with sensitive values replaced by `[Filtered]` (`dataCollection.urlQueryParams`). The path in the `nuxt` context of a server error now goes through `filterCollectedUrl`, like `request.url`. Only the transaction name has no query string.
Contributor
Optional E2E testsAll optional checks were successful. 14 successful. See the run. Successful checks
|
s1gr1d
marked this pull request as ready for review
November 26, 2026 09:07
javascript-sdk-gitflow
Bot
requested review from
RulaKhaled,
chargome and
nicohrubec
November 26, 2026 09:07
chargome
approved these changes
Nov 26, 2026
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Server error events from the Nitro error hook now treat the query string of the request like the rest of the SDK does:
nuxtcontext goes throughdataCollection.urlQueryParams:/api/user?include=profile&auth=[Filtered].GET /api/user.Why
On Nitro v2 (Nuxt 3 and 4), the request path has the query string.
request.urlandrequest.query_stringwere already filtered, but thenuxtcontext and the transaction name had the raw value, so a secret in the URL reached the event.The name on the current scope showed up on Deno, where a later request can inherit that scope: error events of other requests got the name of the failed request. This made
nuxt-4 (deno)fail in #26885.