Skip to content

fix(wsgi): Redact CF-Connecting-IP, True-Client-IP, Forwarded, and X-Client-IP by default - #8108

Open
ryder777777 wants to merge 2 commits into
getsentry:masterfrom
ryder777777:fix/sensitive-client-ip-headers-8097
Open

ryder777777 wants to merge 2 commits into
getsentry:masterfrom
ryder777777:fix/sensitive-client-ip-headers-8097

Conversation

@ryder777777

Copy link
Copy Markdown

Description

Under the default configuration (send_default_pii=False and no explicit data_collection), _filter_headers in sentry_sdk/integrations/_wsgi_common.py only redacted X-Forwarded-For and X-Real-IP among proxy/CDN client IP headers, leaving CF-Connecting-IP, True-Client-IP, Forwarded, and X-Client-IP unredacted on events, transactions, and spans.

This adds HTTP_CF_CONNECTING_IP, HTTP_TRUE_CLIENT_IP, HTTP_FORWARDED, and HTTP_X_CLIENT_IP to SENSITIVE_ENV_KEYS (and removes the duplicate HTTP_X_FORWARDED_FOR entry) so SENSITIVE_HEADERS blanks all six client IP headers by default when PII collection is disabled.

Issues

@ryder777777
ryder777777 requested a review from a team as a code owner October 22, 2026 13:28

This branch has not been deployed

No deployments
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.

Default config still sends client IPs in CF-Connecting-IP, True-Client-IP, Forwarded and X-Client-IP headers

1 participant