Repository navigation
fix: mask secrets in TransferState text and unsigned JWTs - #248
Merged
erkamyaman merged 1 commit intoOct 11, 2026
Merged
Conversation
TransferState entries the page clipped to a string, and text bodies that hold JSON, only had token-shaped text masked, so keys like password or apiKey reached the panel in clear. Mask "key": value pairs in those strings by key, including redaction.secretNames. The NativeScript overlay never applied the redaction config, so custom secretNames and unmask were ignored for its component and signal values. Apply it when the session starts, as the other overlays do. JWTs with an empty signature (alg: none) were not matched by any of the three JWT patterns. Share one pattern that also matches them.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
An audit of redaction and agent exposure turned up three leaks. I traced each one through the code and reproduced it:
responseType: 'text', or an Analogbodyholding JSON text) also arrive as strings. On the server those strings only had JWT, bearer andkey=valuemasking applied, so{"password":"hunter2","apiKey":"sk-live-..."}reached thehttp-payloadsshared state, the panel and agents in clear.sanitizePayloadnow also masks"key": valuepairs by key inside every string, usingredactJsonTextwithisRedactedKey. That coversredaction.secretNamestoo.redactionconfig (P2). It never calledsetRedaction, so customsecretNamesandunmaskhad no effect on its component inputs, signal values and signal history. The server stores those reports as sent. It now applies the config when the session starts, asoverlay.tsandoverlay-angular-native.tsalready do.alg: nonehave an empty signature (eyJ...eyJ....). All three JWT patterns (forms-privacy.ts,router.ts,analog-server-log.ts) required a non-empty third segment. They now share one exported pattern that allows an empty signature.The audit also checked the config gating. Every RPC and agent tool is behind its inspector toggle, and every write tool is in
ACTION_TOOLS, so nothing needed changing there.How it was verified
pnpm commit:checkpnpm format:checkpnpm typecheckpnpm test:devtools(1430 tests pass). I did not runpnpm testorpnpm test:panel;app/is unchanged.pnpm skills:check(not applicable)pnpm extension:build(not applicable,app/unchanged)New tests:
http-payload-redaction.test.tscovers a clipped entry over 20,000 characters, a JSON text body,secretNamesinside a text body, and an unsigned JWT in text and previews.overlay-nativescript-session.test.tschecks that the session appliesredaction.secretNamesfrom the connection.Every new test fails without its fix and passes with it.
Notes for reviewers
\b, matching whatrouter.tsalready did. It can mask a little more text that merely looks like a token; that is the safe direction for this pattern.serializewould be cleaner, but the server-side masking covers the clipped string either way.Generated by Claude Code
Summary by CodeRabbit