Title: `tunnelRoute` passes through Strict-Transport-Security header, enabling HSTS on users' domains · Issue #8931 · getsentry/sentry-javascript · GitHub
Open Graph Title: `tunnelRoute` passes through Strict-Transport-Security header, enabling HSTS on users' domains · Issue #8931 · getsentry/sentry-javascript
X Title: `tunnelRoute` passes through Strict-Transport-Security header, enabling HSTS on users' domains · Issue #8931 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8931
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`tunnelRoute` passes through Strict-Transport-Security header, enabling HSTS on users' domains","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which SDK are you using?\r\n\r\n@sentry/nextjs\r\n\r\n### SDK Version\r\n\r\n7.64.0\r\n\r\n### Framework Version\r\n\r\nNext.js 13.4.19\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\nOn the server:\r\n\r\n```ts\r\nSentry.init({\r\n dsn: process.env.NEXT_PUBLIC_SERVER_SENTRY_DSN,\r\n tracesSampleRate: 1,\r\n debug: false,\r\n release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,\r\n});\r\n```\r\n\r\nOn the client:\r\n\r\n```ts\r\nSentry.init({\r\n dsn: process.env.NEXT_PUBLIC_SERVER_SENTRY_DSN,\r\n tracesSampleRate: 1,\r\n debug: false,\r\n replaysOnErrorSampleRate: 1.0,\r\n replaysSessionSampleRate: 0.1,\r\n integrations: [\r\n new Sentry.Replay({\r\n maskAllText: true,\r\n blockAllMedia: true,\r\n }),\r\n ],\r\n release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,\r\n tracePropagationTargets: [\r\n \"http://localhost:3000\",\r\n \"https://bowser.dev.ystv.co.uk\",\r\n \"https://bowser.ystv.co.uk\",\r\n ],\r\n});\r\n```\r\n\r\nIn `next.config.js`:\r\n\r\n```ts\r\nmodule.exports = withSentryConfig(\r\n nextConfig,\r\n {\r\n silent: true,\r\n org: \"ystv\",\r\n project: \"bowser-server\",\r\n authToken: process.env.SENTRY_AUTH_TOKEN,\r\n release: sentryRelease,\r\n },\r\n {\r\n widenClientFileUpload: true,\r\n transpileClientSDK: false,\r\n tunnelRoute: \"/monitoring\",\r\n hideSourceMaps: true,\r\n disableLogger: true,\r\n disableClientWebpackPlugin: process.env.IS_PRODUCTION_BUILD !== \"true\",\r\n disableServerWebpackPlugin: process.env.IS_PRODUCTION_BUILD !== \"true\",\r\n },\r\n);\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. Set up the Next.js integration with `tunnelRoute` enabled\r\n2. Deploy the application on a hosting provider that does _not_ set `Strict-Transport-Security`\r\n3. Visit a page in the application\r\n4. Watch the browser DevTools Network tab for a request to `/monitoring`\r\n\r\n### Expected Result\r\n\r\nNo `Strict-Transport-Security` header is present on any response\r\n\r\n### Actual Result\r\n\r\nThe initial response from the backend does not have `Strict-Transport-Security`:\r\n\r\n\u003cimg width=\"675\" alt=\"image\" src=\"https://github.com/getsentry/sentry-javascript/assets/2904440/eb4b234c-ef4d-4d73-b020-3c79cd1d05c4\">\r\n\r\n\r\nHowever, the response to the `/monitoring` request has the `Strict-Transport-Security` header from the Sentry SaaS backend:\r\n\r\n\r\n\r\nLooking in chrome://net-internals#hsts you can indeed see that this has unintentionally enabled dynamic HSTS for the domain in question:\r\n\u003cimg width=\"388\" alt=\"image\" src=\"https://github.com/getsentry/sentry-javascript/assets/2904440/99f1a74e-784b-4421-8ede-f7f84d188097\">\r\n\r\nAny subsequent non-HTTPS requests to the domain will now fail.\r\n","author":{"url":"https://github.com/markspolakovs","@type":"Person","name":"markspolakovs"},"datePublished":"2023-09-01T11:46:20Z","url":"https://github.com/getsentry/sentry-javascript/issues/8931"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1357a695-e21e-4f2c-20ef-8c51842d9b00 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D224:72378:3D0A:4E7D:6B04AD57 |
| html-safe-nonce | 392de6e8ff759aeac8d993b9fbfafcb9f07464ab7416fd6e1f99d72be7d5ba70 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjI0OjcyMzc4OjNEMEE6NEU3RDo2QjA0QUQ1NyIsInZpc2l0b3JfaWQiOiI0NTA3MDM3NDg4NDkzNDA3NTc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7533fd5840e96fbe6706699dff8453b98cd2c0d5f8c4c0f65bb918754ed6d28 |
| hovercard-subject-tag | issue:1877276577 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/8931/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ae90ece5fd50067634a8b5083b6086eb3852fc0d1c9e73ffb364f01547d81ed/getsentry/sentry-javascript/issues/8931 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ae90ece5fd50067634a8b5083b6086eb3852fc0d1c9e73ffb364f01547d81ed/getsentry/sentry-javascript/issues/8931 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markspolakovs |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width