René's URL Explorer Experiment


Title: EventScrubber's header entries in DEFAULT_DENYLIST never match request headers · Issue #8272 · getsentry/sentry-python · GitHub

Open Graph Title: EventScrubber's header entries in DEFAULT_DENYLIST never match request headers · Issue #8272 · getsentry/sentry-python

X Title: EventScrubber's header entries in DEFAULT_DENYLIST never match request headers · Issue #8272 · getsentry/sentry-python

Description: The "wsgi" entries in DEFAULT_DENYLIST (sentry_sdk/scrubber.py) are spelled with underscores: x_csrftoken, x_api_key, set_cookie, x_forwarded_for, and x_real_ip in DEFAULT_PII_DENYLIST. scrub_dict compares k.lower() against the list, but...

Open Graph Description: The "wsgi" entries in DEFAULT_DENYLIST (sentry_sdk/scrubber.py) are spelled with underscores: x_csrftoken, x_api_key, set_cookie, x_forwarded_for, and x_real_ip in DEFAULT_PII_DENYLIST. scrub_dict ...

X Description: The "wsgi" entries in DEFAULT_DENYLIST (sentry_sdk/scrubber.py) are spelled with underscores: x_csrftoken, x_api_key, set_cookie, x_forwarded_for, and x_real_ip in DEFAULT_PII_DENYLIST. s...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/8272

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"EventScrubber's header entries in DEFAULT_DENYLIST never match request headers","articleBody":"The \"wsgi\" entries in `DEFAULT_DENYLIST` (`sentry_sdk/scrubber.py`) are spelled with underscores: `x_csrftoken`, `x_api_key`, `set_cookie`, `x_forwarded_for`, and `x_real_ip` in `DEFAULT_PII_DENYLIST`. `scrub_dict` compares `k.lower()` against the list, but the request headers it gets are hyphenated. `_werkzeug._get_headers` turns `HTTP_X_CSRFTOKEN` into `X-Csrftoken`, and `_asgi_common._get_headers` keeps the raw `x-api-key`. So `x-csrftoken` is never equal to `x_csrftoken` and these entries never fire on headers. `proxy-authorization` right next to them uses a hyphen, which makes me think the rest are just WSGI environ names that got lowercased.\r\n\r\nWhat reaches Sentry because of it:\r\n\r\n- With the default `send_default_pii=False`, `_filter_headers` strips only the names in `SENSITIVE_ENV_KEYS`, and `X_CSRFTOKEN` isn't one of them. So Django's `X-CSRFToken` header goes out as is, although the scrubber lists it.\r\n- With `send_default_pii=True`, `_filter_headers` keeps everything, and `X-Api-Key` and `X-CSRFToken` aren't scrubbed even though they are in the security denylist that's supposed to apply regardless of PII.\r\n\r\nChecked on master (26ef571): `capture_event` with `{\"X-Csrftoken\": ..., \"x-api-key\": ..., \"Set-Cookie\": ...}` request headers keeps all three values, with `send_default_pii` on and off.\r\n\r\nNormalizing both sides in `EventScrubber` (e.g. `x.lower().replace(\"-\", \"_\")` for the denylist and the same for the key in `scrub_dict`) fixes it, and a user-supplied `denylist=[\"x-api-key\"]` then matches either spelling. One catch I hit while trying it: `x_forwarded_for` is in `DEFAULT_DENYLIST` too, not only in `DEFAULT_PII_DENYLIST`, so once keys match, `X-Forwarded-For` gets scrubbed even with `send_default_pii=True`. `test_request_headers_legacy_pii_passes_headers_through` and `test_request_headers_legacy_no_pii_redacts_sensitive` in `tests/integrations/wsgi/test_wsgi.py` rely on it not matching (the second one's docstring says so). So I'd also drop `x_forwarded_for` from `DEFAULT_DENYLIST` and leave it to the PII list. The no-PII test would then see the scrubber's `[Filtered]` on top of the emptied value from `_filter_headers`, unless you'd rather have the scrubber skip values that are already an `AnnotatedValue`.\r\n\r\nThis scrubs more than today, so I wanted to check the direction before sending a PR. Happy to do it with tests in `tests/test_scrubber.py`.\r\n","author":{"url":"https://github.com/ratomirjovanovic","@type":"Person","name":"ratomirjovanovic"},"datePublished":"2026-11-15T13:43:06Z","url":"https://github.com/getsentry/sentry-python/issues/8272"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:00dab504-c0fd-9b72-63e8-28d912414fed
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id96AE:185321:57C8A8:7ADB65:6B007617
html-safe-nonce8c6870e040a153cda2d95fe7744b2728d52510d303c35d8b0c03c339ba428e3c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkFFOjE4NTMyMTo1N0M4QTg6N0FEQjY1OjZCMDA3NjE3IiwidmlzaXRvcl9pZCI6IjI0MTI4NzczNDAyMTM1NTAzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacad32be3543826c757a8355c3e6c7cc80cde63c7421194a9eeda69ee22711912a
hovercard-subject-tagissue:6404714058
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/8272/issue_layout
twitter:imagehttps://opengraph.githubassets.com/71f6de27d92384f7bfa26a1ccbd10714e274f3d1ed92e47461359ed1de20bca9/getsentry/sentry-python/issues/8272
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/71f6de27d92384f7bfa26a1ccbd10714e274f3d1ed92e47461359ed1de20bca9/getsentry/sentry-python/issues/8272
og:image:altThe "wsgi" entries in DEFAULT_DENYLIST (sentry_sdk/scrubber.py) are spelled with underscores: x_csrftoken, x_api_key, set_cookie, x_forwarded_for, and x_real_ip in DEFAULT_PII_DENYLIST. scrub_dict ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameratomirjovanovic
hostnamegithub.com
expected-hostnamegithub.com
None75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84e563eb4b55f8fa102f325f117533cee9e3df4a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/8272#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8272
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F8272
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/8272
Reloadhttps://github.com/getsentry/sentry-python/issues/8272
Reloadhttps://github.com/getsentry/sentry-python/issues/8272
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests41 (41)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8272
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8272
#8305https://github.com/getsentry/sentry-python/pull/8305
EventScrubber's header entries in DEFAULT_DENYLIST never match request headershttps://github.com/getsentry/sentry-python/issues/8272#top
#8305https://github.com/getsentry/sentry-python/pull/8305
https://github.com/sentrivana
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
https://github.com/ratomirjovanovic
ratomirjovanovichttps://github.com/ratomirjovanovic
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272#issue-6404714058
26ef571https://github.com/getsentry/sentry-python/commit/26ef57190d48d90e5ae2483db52dd4ce9b863f15
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36192494225
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272#issuecomment-6895209882
Linear Codehttps://linear.app
PY-3078https://linear.app/getsentry/issue/PY-3078
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36192497144
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272
linear-codehttps://github.com/apps/linear-code
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
on Nov 15, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36192523339
https://github.com/sentrivana
sentrivanahttps://github.com/sentrivana
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8272#issuecomment-6944296080
@ratomirjovanovichttps://github.com/ratomirjovanovic
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36387655648
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 17, 2026https://github.com/getsentry/sentry-python/issues/8272
sentrivanahttps://github.com/sentrivana
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36515947269
sentrivanahttps://github.com/sentrivana
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
12c302bhttps://github.com/getsentry/sentry-python/commit/12c302b829d008e615e484bff7c24b56eec93f5e
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36532390134
opensource-fork-synchttps://github.com/apps/opensource-fork-sync
on Nov 18, 2026https://github.com/getsentry/sentry-python/issues/8272#event-36567372660
fix(scrubber): Match hyphenated header keys against the denylist (get…https://github.com/cla7aye15I4nd/opensource-getsentry__sentry-python/commit/12c302b829d008e615e484bff7c24b56eec93f5e
get…https://github.com/getsentry/sentry-python/pull/8305
https://docs.github.com/articles/closing-issues-via-commit-messages
12c302bhttps://github.com/cla7aye15I4nd/opensource-getsentry__sentry-python/commit/12c302b829d008e615e484bff7c24b56eec93f5e
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/8272
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/8272
sentrivanahttps://github.com/sentrivana
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.