Skip to content

chore: Add no-unfiltered-url-attributes rule - #23144

Open
chargome wants to merge 2 commits into
developfrom
feat/lint-rule-unfiltered-url-attributes
Open

chore: Add no-unfiltered-url-attributes rule#23144
chargome wants to merge 2 commits into
developfrom
feat/lint-rule-unfiltered-url-attributes

Conversation

@chargome

@chargome chargome commented Aug 7, 2026

Copy link
Copy Markdown
Member

#23061 moved URL filtering to each write site, so a URL the user attaches themselves is left alone. The tradeoff is that new write sites need to filter urls.

The rule requires url.full, url.query and http.target to be wrapped in filterCollectedUrl, and recognises values that can't carry a query.

Also adds a Bugbot rule for the shapes a lint rule can't see, like a URL passed through a helper first or attached to a breadcrumb instead of a span.

@chargome chargome self-assigned this Aug 7, 2026

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.

This rule here is pure claude but it actually found two occurrences in our code so that checks out.

@chargome chargome changed the title feat(eslint-plugin-sdk): Add no-unfiltered-url-attributes rule chore: Add no-unfiltered-url-attributes rule Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.34 kB - -
@sentry/browser - with treeshaking flags 28.55 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.86 kB - -
@sentry/browser (incl. Tracing) 47.81 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.82 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.55 kB - -
@sentry/browser (incl. Tracing, Replay) 87.19 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.62 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.91 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.56 kB - -
@sentry/browser (incl. Feedback) 47.68 kB - -
@sentry/browser (incl. sendFeedback) 35.17 kB - -
@sentry/browser (incl. FeedbackAsync) 40.34 kB - -
@sentry/browser (incl. Metrics) 31.41 kB - -
@sentry/browser (incl. Logs) 31.66 kB - -
@sentry/browser (incl. Metrics & Logs) 32.32 kB - -
@sentry/react 32.15 kB - -
@sentry/react (incl. Tracing) 50.06 kB - -
@sentry/vue 35.45 kB - -
@sentry/vue (incl. Tracing) 49.82 kB - -
@sentry/svelte 30.37 kB - -
CDN Bundle 32.34 kB - -
CDN Bundle (incl. Tracing) 48.13 kB - -
CDN Bundle (incl. Logs, Metrics) 33.88 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.46 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.23 kB - -
CDN Bundle (incl. Tracing, Replay) 85.74 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.02 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.86 kB - -
CDN Bundle - uncompressed 95.88 kB - -
CDN Bundle (incl. Tracing) - uncompressed 143.58 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.5 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.56 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.2 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.5 kB - -
@sentry/nextjs (client) 52.62 kB - -
@sentry/sveltekit (client) 48.26 kB - -
@sentry/core/server 65.77 kB - -
@sentry/core/browser 52 kB - -
@sentry/node 119.43 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.42 kB +0.01% +1 B 🔺
@sentry/aws-serverless 92.74 kB - -
@sentry/cloudflare (withSentry) - minified 214.89 kB - -
@sentry/cloudflare (withSentry) 530.77 kB - -

View base workflow run

@chargome
chargome marked this pull request as ready for review August 7, 2026 10:30
@chargome
chargome requested a review from a team as a code owner August 7, 2026 10:30
@chargome
chargome requested review from logaretm and stephanie-anderson and removed request for a team August 7, 2026 10:30
@chargome
chargome force-pushed the feat/lint-rule-unfiltered-url-attributes branch 2 times, most recently from f83d4be to e7330aa Compare August 7, 2026 12:45
Comment thread .oxlintrc.base.json
},
"overrides": [
{
"files": ["**/src/**/*.ts", "**/src/**/*.tsx"],

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 new lint rule's configuration in .oxlintrc.base.json excludes the packages/ember/addon/ directory, which contains unfiltered URL collection sites.
Severity: HIGH

Suggested Fix

Update the glob pattern in .oxlintrc.base.json to include the packages/ember/addon/ directory. For example, change **/src/**/*.ts to something broader like packages/**/*.ts or add **/addon/**/*.ts to the list of included paths.

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: .oxlintrc.base.json#L66

Potential issue: The new `no-unfiltered-url-attributes` lint rule is configured to run
only on files within `src` directories. However, the `packages/ember/addon/` directory
contains code that writes unfiltered URLs to Sentry spans, specifically at
`instrumentEmberAppInstanceForPerformance.ts:113`. Because the lint rule's glob pattern
in `.oxlintrc.base.json` excludes this path, it will not flag this existing issue or any
future unfiltered URL additions in that directory, allowing full URLs with query
parameters to be collected from Ember applications regardless of user settings.

Also affects:

  • packages/ember/addon/utils/instrumentEmberAppInstanceForPerformance.ts:113

Base automatically changed from fix/filter-url-full-in-requestdata-and-navigate to develop August 7, 2026 13:01
@chargome
chargome requested a review from a team as a code owner August 7, 2026 13:01
@chargome
chargome requested review from mydea and s1gr1d and removed request for a team August 7, 2026 13:01
chargome and others added 2 commits August 7, 2026 15:01
URL attributes are filtered at each write site rather than centrally, so that a
URL a user attaches themselves is left alone. The tradeoff is that a site which
forgets to filter leaks silently, which has already happened twice.

The rule requires `url.full`, `url.query` and `http.target` to be wrapped in
`filterCollectedUrl`, and recognises values that cannot carry a query: the
query-stripping helpers, locals holding an already-filtered value, literals and
regex matchers. Two non-HTTP resource identifiers opt out explicitly.

Also adds a Bugbot rule for the shapes a lint rule cannot see, such as a URL
passed through a helper first or attached to a breadcrumb instead of a span.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…lly read it

Each package has its own `.oxlintrc.json` that extends `.oxlintrc.base.json`
rather than the root config, so a rule enabled only at the root never runs for
anything under `packages/`. Declare the plugin and the rule in the base config
instead, scoped to `src` so tests asserting on URL attributes are not flagged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome
chargome force-pushed the feat/lint-rule-unfiltered-url-attributes branch from e7330aa to 122d09b Compare August 7, 2026 13:01
Comment thread .oxlintrc.base.json
},
"overrides": [
{
"files": ["**/src/**/*.ts", "**/src/**/*.tsx"],

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 lint rule sdk/no-unfiltered-url-attributes has a file path configuration that excludes the Ember package, failing to catch an unfiltered URL attribute write.
Severity: HIGH

Suggested Fix

Update the files glob pattern for the sdk/no-unfiltered-url-attributes rule in .oxlintrc.base.json to include the Ember package's file paths, such as by adding **/addon/**/*.ts to the array.

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: .oxlintrc.base.json#L66

Potential issue: The lint rule `sdk/no-unfiltered-url-attributes` is configured with a
file glob `**/src/**/*.ts` that does not include files in the Ember package's `addon/`
directory. Consequently, the rule fails to detect an unfiltered URL attribute write in
`packages/ember/addon/utils/instrumentEmberAppInstanceForPerformance.ts`. This file sets
the `url.full` attribute directly with the output of `getAbsoluteUrl()`, which does not
filter query parameters. This can lead to the collection and transmission of sensitive
data within URL query parameters from Ember applications to Sentry.

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.

3 participants