Skip to content

fix(browser): Apply urlQueryParams to the Referer header - #25324

Merged
JPeer264 merged 1 commit into
developfrom
jp/browser-referer-sensitive-query-params
Oct 14, 2026
Merged

JPeer264 merged 1 commit into
developfrom
jp/browser-referer-sensitive-query-params

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

closes #25303
closes JS-3918

Description

This applies dataCollection.urlQueryParams to the Referer header that the browser SDK collects from document.referrer. Sensitive query params of the previous page are now filtered in request.headers.Referer of error events and static transactions, and in the http.request.header.referer span attribute.

Known issues

We do have a button to go to this page. By now adding filters we redirect to a potential broken page, but this can't and shouldn't be fixed, as this is filtered.

Screenshot 2026-10-13 at 14 21 34

Sentry events

Before (11.7.0), the Referer has jwt=sensitive-jwt-value: https://sentry-sdks.sentry.io/issues/7789837458/events/b27e43ad65b7405b8e030ebbcbff37e1/?project=4510555608449024
After, the Referer has jwt=[Filtered]: https://sentry-sdks.sentry.io/issues/7789837458/events/e5d05ddd3fd14c40a0c24e26e962223c/?project=4510555608449024

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

JS-3918

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.83 kB -0.02% -4 B 🔽
@sentry/browser - with treeshaking flags 27.96 kB +0.03% +7 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.87 kB -0.03% -7 B 🔽
@sentry/browser (incl. Tracing) 52.02 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.02 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Profiling) 54.96 kB - -
@sentry/browser (incl. Tracing, Replay) 91.77 kB +0.03% +24 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.64 kB +0.02% +16 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.5 kB +0.03% +24 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.44 kB +0.01% +5 B 🔺
@sentry/browser (incl. Feedback) 47.34 kB -0.02% -5 B 🔽
@sentry/browser (incl. sendFeedback) 34.9 kB +0.03% +9 B 🔺
@sentry/browser (incl. FeedbackAsync) 39.99 kB -0.03% -9 B 🔽
@sentry/browser (incl. Metrics) 30.86 kB +0.02% +5 B 🔺
@sentry/browser (incl. Logs) 31.13 kB -0.01% -3 B 🔽
@sentry/browser (incl. Metrics & Logs) 31.76 kB -0.05% -15 B 🔽
@sentry/react 31.65 kB +0.02% +6 B 🔺
@sentry/react (incl. Tracing) 54.34 kB -0.01% -5 B 🔽
@sentry/vue 37.99 kB +0.04% +12 B 🔺
@sentry/vue (incl. Tracing) 54.96 kB +0.03% +12 B 🔺
@sentry/svelte 29.85 kB -0.03% -6 B 🔽
@sentry/remix (Remix 3 client bundle) 57.02 kB +0.02% +7 B 🔺
CDN Bundle 31.57 kB +0.03% +7 B 🔺
CDN Bundle (incl. Tracing) 52.53 kB +0.02% +9 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.78 kB +0.04% +13 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.47 kB +0.02% +8 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.72 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.2 kB +0.02% +10 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.12 kB +0.02% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.35 kB +0.02% +13 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.29 kB +0.02% +14 B 🔺
CDN Bundle - uncompressed 92.99 kB +0.01% +9 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 155.84 kB +0.01% +11 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.53 kB +0.01% +9 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.8 kB +0.01% +11 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.57 kB +0.01% +9 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.01 kB +0.01% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.95 kB +0.01% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.71 kB +0.01% +11 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.65 kB +0.01% +11 B 🔺
@sentry/nextjs (client) 56.75 kB +0.01% +1 B 🔺
@sentry/sveltekit (client) 52.4 kB -0.01% -5 B 🔽
@sentry/core/server 40.99 kB - -
@sentry/core/browser 13.81 kB - -
@sentry/node 151.96 kB +0.01% +5 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.78 kB - -
@sentry/node - without tracing 94.54 kB +0.01% +3 B 🔺
@sentry/node - without channel injection 130.14 kB +0.01% +5 B 🔺
@sentry/aws-serverless 102.69 kB +0.01% +6 B 🔺
@sentry/cloudflare (withSentry) - minified 210.38 kB - -
@sentry/cloudflare (withSentry) 521.61 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 228.06 kB - -

View base workflow run

@JPeer264

Copy link
Copy Markdown
Member Author

bugbot run

`document.referrer` holds the full URL of the previous page, including its
query string. `getHttpRequestData` now applies
`dataCollection.urlQueryParams` to it, so sensitive query params no longer
reach `request.headers.Referer` of error events and static transactions, or
the `http.request.header.referer` span attribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/browser-referer-sensitive-query-params branch from 70c9fc9 to 7958755 Compare October 13, 2026 14:15

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7958755. Configure here.

@JPeer264
JPeer264 marked this pull request as ready for review October 13, 2026 14:48
@JPeer264
JPeer264 requested a review from a team as a code owner October 13, 2026 14:48
@JPeer264
JPeer264 requested review from logaretm and msonnb and removed request for a team October 13, 2026 14:48
@JPeer264 JPeer264 self-assigned this Oct 13, 2026
@JPeer264
JPeer264 requested a review from Lms24 October 13, 2026 14:49

@msonnb msonnb left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol
Image

@JPeer264

Copy link
Copy Markdown
Member Author

ok TIL 😆

@JPeer264
JPeer264 merged commit f4ae6c5 into develop Oct 14, 2026
708 of 712 checks passed
@JPeer264
JPeer264 deleted the jp/browser-referer-sensitive-query-params branch October 14, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sensitive query parameters leak to Sentry in event Referer HTTP header

2 participants