Skip to content

fix(live_view): scrub sensitive data from LiveView breadcrumbs#1051

Open
solnic wants to merge 6 commits intomasterfrom
fix/scrub-lv-params
Open

fix(live_view): scrub sensitive data from LiveView breadcrumbs#1051
solnic wants to merge 6 commits intomasterfrom
fix/scrub-lv-params

Conversation

@solnic
Copy link
Copy Markdown
Collaborator

@solnic solnic commented May 7, 2026

Sentry.LiveViewHook previously stored raw event params, handle_params params, and URIs directly in breadcrumbs. Form submissions over the LiveView WebSocket frequently contain passwords, tokens, and other secrets, which were forwarded to Sentry unredacted.

The hook now passes breadcrumb data through Sentry.Scrubber.scrub_map/2 and URIs through Sentry.Scrubber.scrub_url/2 before adding them to the breadcrumb trail. Users can override the scrubber by passing a {module, function, args} tuple via on_mount opts, mirroring the override mechanism already provided by Sentry.PlugCapture:

    on_mount {Sentry.LiveViewHook, scrubber: {MyApp.Scrubber, :scrub, []}}

Sentry.LiveViewHook previously stored raw event params, handle_params
params, and URIs directly in breadcrumbs. Form submissions over the
LiveView WebSocket frequently contain passwords, tokens, and other
secrets, which were forwarded to Sentry unredacted.

The hook now passes breadcrumb data through Sentry.Scrubber.scrub_map/2
and URIs through Sentry.Scrubber.scrub_url/2 before adding them to the
breadcrumb trail. Users can override the scrubber by passing a
{module, function, args} tuple via on_mount opts, mirroring the
override mechanism already provided by Sentry.PlugCapture:

    on_mount {Sentry.LiveViewHook, scrubber: {MyApp.Scrubber, :scrub, []}}

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@solnic solnic marked this pull request as ready for review May 7, 2026 06:51
cursor[bot]

This comment was marked as resolved.

Comment thread lib/sentry/live_view_hook.ex Outdated
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.

1 participant