Skip to content

fix(core): [Remove sendDefaultPii 3] Filter sensitive URL fragment values - #6814

Merged
adinauer merged 7 commits into
9.x.xfrom
fix/data-collection-url-fragments
Nov 30, 2026
Merged

adinauer merged 7 commits into
9.x.xfrom
fix/data-collection-url-fragments

Conversation

@adinauer

@adinauer adinauer commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Remove sendDefaultPii)


📜 Description

Apply the urlQueryParams Data Collection policy to URL fragments before attaching them to requests, spans, and HTTP breadcrumbs. Sensitive fragment parameters are filtered using the same deny-list and allow-list behavior as query parameters, while ordinary anchors, hash-route paths, and encoded parameter text remain unchanged.

Existing query parameter filtering keeps its current behavior.

💡 Motivation and Context

URL fragments can carry sensitive values, including OAuth and OpenID Connect tokens, and hash-based applications can place query parameters after the fragment. Data Collection specification v0.19.0 requires urlQueryParams to filter these values and to omit fragments entirely when collection is off.

💚 How did you test it?

  • Added tests for default filtering, hash routes, plain anchors, encoded parameters, and off mode across request, span, and breadcrumb data.
  • Ran focused UrlUtilsTest and HttpUtilsTest tests.
  • Ran make format api.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

None.

⚠️ Merge this PR into #6799 using a merge commit (not squash). Then merge #6799 into #6793 and squash-merge #6793 into 9.x.x.

Apply the URL query parameter Data Collection policy to fragments so tokens and other sensitive values are not attached in plaintext. Preserve hash routes, anchors, and encoded parameter text while keeping existing query filtering behavior unchanged.
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 05db324.

Main concerns: data sent to Sentry, reach, public contract.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.66.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
@adinauer
adinauer marked this pull request as ready for review November 30, 2026 14:07
@adinauer
adinauer requested a review from a team as a code owner November 30, 2026 14:07
@adinauer
adinauer requested review from 0xadam-brown and runningcode and removed request for a team November 30, 2026 14:07
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026

@romtsn romtsn left a comment

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.

LGTM.

We also would have update the docs for v9 - we still say “URL fragments aren't controlled by Data Collection.” in the Java and Android guides

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
Move the PR #6814 changelog entry to Breaking Changes and describe how Data Collection now filters or removes URL fragments.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
Base automatically changed from fix/remove-send-default-pii-v9-empty-cookies to 9.x.x November 30, 2026 16:30
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
Resolve the URL query parameter collection behavior once per parsed URL and reuse it for query and fragment filtering. This avoids allocating the default deny list twice.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 30, 2026
@adinauer
adinauer merged commit c134f76 into 9.x.x Nov 30, 2026
44 of 46 checks passed
@adinauer
adinauer deleted the fix/data-collection-url-fragments branch November 30, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants