Files
zeekayandHanzo Dev 2a44a6de83 replay: close three ways a secret left the browser
Found by recording a real page in a real browser and grepping the payload for
canaries, which is the only test that can find these. All three passed review and
passed the suite.

maskAllInputs is NOT "mask everything". rrweb reads `true` as "use MY hardcoded
type list instead of yours", and that list has no `hidden` — so the table this
package passed was discarded and a hidden input's value serialized in full. A
CSRF token rode out in the FullSnapshot of a login form (reproduced, canary
`CSRF-LEAK-CANARY-…`). Passing `false` plus our own complete table keeps the
decision in maskInput(), which already refuses SECURE_TYPES whatever the mode
says. Same policy, one authority, and `hidden`/`checkbox`/`radio`/`file` are in
the table now — the types carrying a value the user never typed and never sees.

A secret key was accepted. `publishable()` existed and only the beacon path
consulted it, so an `sk-` key was refused on unload and sent in an Authorization
header on every other batch. The test named "refuses to start without a
publishable key" only ever asserted the empty string. record() now refuses any
non-`pk-` key, so a secret has no carrier out of the browser rather than one
carrier that happens to refuse it.

The rrweb escape hatch is spread first, so an option the gate does not NAME is
one the caller can still set. recordCrossOriginIframes (another origin's DOM,
which our policy cannot reach inside to mask), collectFonts and plugins are now
pinned, as are blockClass/ignoreClass/maskTextClass — renaming those silently
disarms every rr-block already written into the app's markup.

Each fix has a test that fails against the previous commit; verified by running
the new tests against it (4 failed, 66 passed).

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-05 13:25:45 -07:00
..