Title: Sentry captures incorrect IP address · Issue #16768 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry captures incorrect IP address · Issue #16768 · getsentry/sentry-javascript
X Title: Sentry captures incorrect IP address · Issue #16768 · 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/16768
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry captures incorrect IP address","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSelf-hosted/on-premise\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\n9.30.0\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\n1. Deploy application behind multiple reverse proxies (e.g., CDN → Load Balancer → Application)\n2. Configure proxies to forward client IP via `X-Forwarded-For` header\n3. Make requests through the proxy chain\n4. Observe IP address captured in Sentry user context\n\n### Expected Result\n\nSentry should extract and use the original client IP address from the `X-Forwarded-For` header. \n\nFor example, with header: `X-Forwarded-For: [user's real ip], 172.70.82.11`\nThe user context should show the original client IP from the first position in the header.\n\n### Actual Result\n\nSentry captures the direct connection IP instead of parsing the forwarded headers. In this case, it shows `10.244.5.65` (internal proxy IP) in the user context.\n\nThe trace data correctly captures the client IP in `http.client_ip`, but the user context shows the proxy IP.\n\n### Trace Data\n\n```json\n{\n \"http.client_ip\": \"[user's real ip]\",\n \"http.flavor\": \"1.1\", \n \"http.host\": \"example.com\",\n \"http.request_content_length_uncompressed\": 59,\n \"http.request_method\": \"POST\",\n \"http.response.status_code\": 200,\n \"http.route\": \"/api\",\n \"http.scheme\": \"http\",\n \"http.status_code\": 200,\n \"http.status_text\": \"OK\",\n \"http.target\": \"/api\",\n \"http.url\": \"http://example.com/api\",\n \"http.user_agent\": \"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36\",\n \"net.host.ip\": \"10.244.7.162\",\n \"net.host.name\": \"example.com\", \n \"net.host.port\": 3000,\n \"net.peer.ip\": \"10.244.5.65\",\n \"net.peer.port\": 35180,\n \"net.transport\": \"ip_tcp\",\n \"otel.kind\": \"SERVER\",\n \"sentry.op\": \"http.server\",\n \"sentry.origin\": \"auto.http.otel.http\",\n \"sentry.source\": \"route\",\n \"url\": \"http://example.com/api\"\n}","author":{"url":"https://github.com/amplitudesxd","@type":"Person","name":"amplitudesxd"},"datePublished":"2025-06-29T21:56:12Z","url":"https://github.com/getsentry/sentry-javascript/issues/16768"}
| 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:4dfd4653-e3d9-5856-743d-42752d9d09a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B4C:1CB7BC:256F4A:3387CC:6B04528A |
| html-safe-nonce | 27c90002535d088db960f00c6a951d48e5653446a75b29510b62e23f8e47f943 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjRDOjFDQjdCQzoyNTZGNEE6MzM4N0NDOjZCMDQ1MjhBIiwidmlzaXRvcl9pZCI6IjcxMTYzODczMzcwNzAzOTM3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 523a9ca4f79c81923683a8ff1bd46cc2eaf8933cca0b2bc96b4136df5a7a32a2 |
| hovercard-subject-tag | issue:3186607771 |
| 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/16768/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ca01c616552209e938894eceac4ff4e2f0bd75eb71b7acb4c83bc3e3cea37891/getsentry/sentry-javascript/issues/16768 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ca01c616552209e938894eceac4ff4e2f0bd75eb71b7acb4c83bc3e3cea37891/getsentry/sentry-javascript/issues/16768 |
| 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 | amplitudesxd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0 |
| 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 | e086f9b7e88322eb2b41885a6ad425b215737fa5 |
| 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