Skip to content

ref(core): Deprecate sendDefaultPii in favor or dataCollection#21277

Merged
s1gr1d merged 4 commits into
developfrom
sig/deprecate-sendDefaultPii
Jun 2, 2026
Merged

ref(core): Deprecate sendDefaultPii in favor or dataCollection#21277
s1gr1d merged 4 commits into
developfrom
sig/deprecate-sendDefaultPii

Conversation

@s1gr1d
Copy link
Copy Markdown
Member

@s1gr1d s1gr1d commented Jun 2, 2026

Deprecates sendDefaultPii.

Some sendDefaultPii occurences are still there as we still test against the deprecated behavior. This will be removed in v11.

Closes #20937

@s1gr1d s1gr1d force-pushed the sig/deprecate-sendDefaultPii branch from f7c312e to 1d8958c Compare June 2, 2026 09:14
@s1gr1d s1gr1d marked this pull request as ready for review June 2, 2026 09:43
@s1gr1d s1gr1d requested review from a team as code owners June 2, 2026 09:43
@s1gr1d s1gr1d requested review from a team, JPeer264, chargome, logaretm, mydea and nicohrubec and removed request for a team and logaretm June 2, 2026 09:43
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread packages/core/src/types/options.ts Outdated
Comment thread packages/vue/src/errorhandler.ts Outdated
Comment thread packages/vercel-edge/src/sdk.ts Outdated
@s1gr1d s1gr1d requested a review from chargome June 2, 2026 11:45
@s1gr1d
Copy link
Copy Markdown
Member Author

s1gr1d commented Jun 2, 2026

@BugBot review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 707e738. Configure here.

Comment thread CHANGELOG.md
genAI: { inputs: false, outputs: false },
httpHeaders: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },
cookies: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },
queryParams: { deny: ['forwarded', '-ip', 'remote-', 'via', '-user'] },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-l: Should we use different deny examples for each entry?

For cookies we could use csrf or token, and for queryParams there would be state for OAuth requests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csrf and token are sensitive and will be filtered always: https://github.com/getsentry/sentry-javascript/blob/develop/packages/core/src/utils/data-collection/filtering-snippets.ts|

We can also include state in there.

Copy link
Copy Markdown
Member

@JPeer264 JPeer264 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting fails, but once this is through it is a LGTM

Copy link
Copy Markdown
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Let's wait until we docs in place for this before merging 👍

Comment on lines 59 to 61
consoleIntegration(),
// TODO(v11): integration can be included - but integration should not add IP address etc
...(options.sendDefaultPii ? [requestDataIntegration()] : []),
requestDataIntegration(),
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The requestDataIntegration() is now always included, causing unintended collection of request headers, cookies, and query parameters for users who haven't opted into PII collection.
Severity: HIGH

Suggested Fix

Reinstate a guard around the requestDataIntegration() inclusion. The integration should only be added if the user has explicitly opted into data collection, for example by checking sendDefaultPii or a more modern data collection option. This will prevent the default collection of sensitive request data for users who have not consented.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/vercel-edge/src/sdk.ts#L59-L61

Potential issue: The removal of the `sendDefaultPii` guard around
`requestDataIntegration()` in the `vercel-edge` SDK causes it to be unconditionally
included. By default, this integration collects and sends request headers, cookies, and
query parameters, even when `sendDefaultPii` is not explicitly enabled. This is a change
in behavior for existing users who previously did not have this data collected, leading
to an unintended privacy regression where potentially sensitive information is sent to
Sentry without explicit opt-in.

Did we get this right? 👍 / 👎 to inform future reviews.

@s1gr1d s1gr1d merged commit ff50e60 into develop Jun 2, 2026
268 of 269 checks passed
@s1gr1d s1gr1d deleted the sig/deprecate-sendDefaultPii branch June 2, 2026 13:58
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.

Deprecate sendDefaultPii, resolve remaining TODOs

3 participants