fix(browse): redact form fields with sensitive names, not just type=password#860
Open
garagon wants to merge 1 commit intogarrytan:mainfrom
Open
fix(browse): redact form fields with sensitive names, not just type=password#860garagon wants to merge 1 commit intogarrytan:mainfrom
garagon wants to merge 1 commit intogarrytan:mainfrom
Conversation
…assword The forms command only redacted input values for type="password". Hidden inputs and text fields with names like csrf_token, api_key, session_id were exposed unredacted in the LLM context. Cookies and storage already use SENSITIVE_COOKIE_NAME pattern matching against field names. Apply the same pattern to form field name and id attributes for consistency.
Contributor
Author
|
CI note: the E2E eval failures require ANTHROPIC_API_KEY which is not available on fork PRs. Free tests (build-image) pass. The change is a 3-line addition to the forms redaction logic inside a page.evaluate() callback — no impact on eval test paths. |
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
Add name and id pattern matching to the forms command redaction logic in
browse/src/read-commands.ts.Why
The
$B formscommand only redacted values fortype="password"inputs. Hidden inputs and text fields with sensitive names were exposed unredacted in the LLM context:Cookies and storage already use
SENSITIVE_COOKIE_NAMEpattern matching against names containingtoken,secret,key,password,credential,auth,jwt,session,csrf,sid, andapi_key. This PR applies the same pattern to form fieldnameandidattributes.The regex runs inside
page.evaluate()(browser context) so it's inlined rather than referencing the Node export.Files
browse/src/read-commands.ts: line 148, forms case