Skip to content

fix(plug): broader scrubbing#1070

Draft
solnic wants to merge 3 commits into
fix/scrub-sensitive-data-from-stacktracesfrom
fix/broaden-conn-scrubber
Draft

fix(plug): broader scrubbing#1070
solnic wants to merge 3 commits into
fix/scrub-sensitive-data-from-stacktracesfrom
fix/broaden-conn-scrubber

Conversation

@solnic
Copy link
Copy Markdown
Collaborator

@solnic solnic commented May 26, 2026

TBD

@solnic solnic force-pushed the refa/consolidate-plug-scrubber-access branch 3 times, most recently from dbe6f3d to 8408dda Compare May 28, 2026 10:59
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch 2 times, most recently from 4b61f38 to 2cf2586 Compare June 1, 2026 09:38
@solnic solnic force-pushed the refa/consolidate-plug-scrubber-access branch 2 times, most recently from 4b4dd34 to e05c35a Compare June 3, 2026 12:35
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch from 2cf2586 to 67cf7dd Compare June 3, 2026 12:35
@solnic solnic changed the base branch from refa/consolidate-plug-scrubber-access to fix/scrub-sensitive-data-from-stacktraces June 3, 2026 12:35
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch from 67cf7dd to 7b02f6c Compare June 3, 2026 12:46
@solnic solnic force-pushed the fix/scrub-sensitive-data-from-stacktraces branch 2 times, most recently from 03dd2d1 to 9240a03 Compare June 3, 2026 13:38
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch from 7b02f6c to 613318d Compare June 3, 2026 13:38
@solnic solnic force-pushed the fix/scrub-sensitive-data-from-stacktraces branch from 9240a03 to 587cfb4 Compare June 4, 2026 10:26
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch 3 times, most recently from 249ba4a to ddb724d Compare June 4, 2026 11:23
solnic and others added 3 commits June 4, 2026 14:56
Add a Phoenix integration endpoint that fabricates a plain
FunctionClauseError (not a Phoenix.ActionClauseError) and assert that its
captured stacktrace frame vars are scrubbed by Sentry.Event via
StacktraceScrubber, independently of PlugCapture's ActionClauseError handling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Expand the default @scrubbable_conn_fields so scrub/1 also clears req_cookies
and assigns, scrubs body_params and query_params with the default sensitive
keys, and reduces private to an allow-list of framework metadata — in addition
to today's cookies/req_headers/params.

assigns is cleared wholesale because auth libraries (Guardian, Pow, Coherence)
routinely store decoded tokens, full user structs, and password hashes there,
where no key-based heuristic redacts safely. private mixes sensitive data (the
decoded session under :plug_session, Guardian's raw JWT) with high-signal
framework routing metadata, so it uses the :private_allow_list strategy: Phoenix
routing/render keys are retained (configurable via :scrub_conn_private_allow_list)
and everything else is dropped. This keeps the most useful triage breadcrumb —
which controller/action failed — without leaking secrets.

Expressed entirely through the strategy-aware attribute and the allow-list
mechanism from earlier commits — no changes to scrub/1 dispatch or to the
consumers (Sentry.PlugContext and Sentry.PlugCapture both funnel through
Sentry.Scrubber.scrub/1). The PlugContext request-interface payload is unchanged
(it reads back only params/cookies/req_headers); the broadening manifests on the
PlugCapture ActionClauseError conn path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…q_cookies scrubbing

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@solnic solnic force-pushed the fix/broaden-conn-scrubber branch from c3da499 to 72a3430 Compare June 4, 2026 14:59
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