feat(cloudflare): Migrate to dataCollection#21237
Draft
chargome wants to merge 1 commit into
Draft
Conversation
| requestDataIntegration(), | ||
| consoleIntegration(), | ||
| ]; | ||
| } |
There was a problem hiding this comment.
Auth and session cookies now captured in Sentry events by default after removing explicit cookie exclusion
Removing the explicit { include: { cookies: false } } guard from requestDataIntegration() causes all HTTP cookies — including session tokens, auth tokens, and CSRF cookies — to be captured in Sentry error events by default, because the new default dataCollection.cookies value ({ deny: PII_HEADER_SNIPPETS }) evaluates to true in the include.cookies check and the event path in extractNormalizedRequestData performs no further deny-list filtering.
Evidence
requestDataIntegration()(no options) callsresolveIncludeAndDataCollection(client)inpackages/core/src/integrations/requestdata.ts.- With no
dataCollectionorsendDefaultPiiset,client.getDataCollectionOptions()returnscookies: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] }— patterns for IP headers, not cookie names. include.cookies = dataCollection.cookies !== falseevaluates totruebecause{ deny: [...] } !== false.extractNormalizedRequestDatathen unconditionally executesrequestData.cookies = parseCookie(headers.cookie)wheninclude.cookiesistrue, adding all cookies toevent.request.cookieswith no deny-list filtering.- Previously
requestDataIntegration({ include: { cookies: false } })short-circuited this path entirely; theSENSITIVE_COOKIE_NAME_SNIPPETSfiltering only applies in the span/httpHeadersToSpanAttributespath, not in the event processing path.
Identified by Warden security-review · EBZ-JZ3
Contributor
size-limit report 📦
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Migrates the Cloudflare SDK from
sendDefaultPiito the newdataCollectionspec.sdk.ts: RemovesendDefaultPii-based conditional forrequestDataIntegration. The integration now derives its include config fromclient.getDataCollectionOptions()internally.request.ts: Passclient.getDataCollectionOptions()tohttpHeadersToSpanAttributesinstead ofsendDefaultPii.httpServer.ts:maxRequestBodySizeno longer defaults to'medium'— falls back todataCollection.httpBodies(captures at'medium'if'incomingRequest'is listed, otherwise no capture). Integration-level option still takes precedence when explicitly set.Fixes #20934