You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EventScrubber.scrub_request() filters request.headers, request.cookies, and request.data, but omits request.query_string. The AWS Lambda integration populates that field as a mapping from queryStringParameters when the explicit data_collection configuration is not used. As a result, sensitive values under token / authorization / password remain in a captured event even though the same keys are covered elsewhere by the existing denylist.
This is a specific sensitive-data redaction gap, not a claim of a separately demonstrated remote exploit.
Fix
Reuse the existing scrub_dict and scrub_list on request.query_string:
Filter default and custom denied keys in query parameter mappings, including case-insensitive names and list values.
Preserve unaffected values and normal redaction metadata.
Preserve existing raw URL-encoded query-string behavior unchanged (mapping-only fix), avoiding compatibility regressions and interference with data_collection.
After: the field contains [Filtered] and the standard !config redaction metadata.
Added five upstream tests: sensitive mapping keys, custom denylist, raw-string compatibility, list-of-mappings, and a captured-event end-to-end test.
A six-case local reproduction harness passes; also tested a full sentry_sdk.capture_event() path locally and verified both the filtered value and _meta.
Upstream repository-wide CI is not yet validated: GitHub currently reports action_required for the forked PR workflows, which need maintainer approval to run.
Related to #4441's expectations for query parameter scrubbing, but does not close#4441 because that report concerns raw string query parameters; this fix addresses mappings (including AWS Lambda).
Hey @mhatipog, thanks for the PR. We're retiring the event scrubber in favor of data_collection, which allows you to specify scrubbing rules for query strings. Considering that, we'll not invest more time in improving the current default event scrubber.
For anyone reading this: If you can't migrate to data_collection, you can still define your own event scrubber that implements scrubbing fit for your usecase. Just note that event_scrubber will be removed in version 3.0 of the SDK. Alternatively, modifying the event in before_send is also an option (and one that will still be around in 3.0).
Thanks for clarifying, Ivana. I hadn't realized event_scrubber was being phased out. Makes sense to close this; I'll take a look at the data_collection path instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
EventScrubber.scrub_request()filtersrequest.headers,request.cookies, andrequest.data, but omitsrequest.query_string. The AWS Lambda integration populates that field as a mapping fromqueryStringParameterswhen the explicitdata_collectionconfiguration is not used. As a result, sensitive values undertoken/authorization/passwordremain in a captured event even though the same keys are covered elsewhere by the existing denylist.This is a specific sensitive-data redaction gap, not a claim of a separately demonstrated remote exploit.
Fix
Reuse the existing
scrub_dictandscrub_listonrequest.query_string:data_collection.Reproduction and tests
EventScrubber().scrub_event({"request": {"query_string": {"token": "SECRET"}}})retainsSECRET.[Filtered]and the standard!configredaction metadata.sentry_sdk.capture_event()path locally and verified both the filtered value and_meta.action_requiredfor the forked PR workflows, which need maintainer approval to run.Related to #4441's expectations for query parameter scrubbing, but does not close #4441 because that report concerns raw string query parameters; this fix addresses mappings (including AWS Lambda).