Skip to content

fix(runtime): redact password fields in page snapshots - #18

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-7e6b
Draft

fix(runtime): redact password fields in page snapshots#18
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/high-severity-issues-7e6b

Conversation

@cursor

@cursor cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

Bug and impact

BrowserRuntime.snapshot forwarded Playwright ariaSnapshot() and page.content() with no password redaction. Filled input[type=password] values (and static value attributes) appeared in accessibilityTree / htmlSnippet, then in companion HTTP responses and MCP tool JSON, so secrets reached the agent context.

Trigger: login form with #pw type=password, type the secret into #pw, then snapshot. Live Chromium repro on this branch: typed secret was present in the ARIA tree before the fix and absent after. A static value attribute leaked in HTML before the fix and is blanked after.

Root cause

Playwright's ARIA serializer puts element.value into the tree for password inputs. There is no in-API redaction option. Webchain captured the tree and HTML as-is.

Fix

Blank matching password fields (type=password and autocomplete current/new/one-time-password) in the page before capture, restore them in finally so the live form stays usable.

Validation

  • Unit: pnpm --filter @webchain/runtime test and typecheck (29 tests). Helpers cover blank/restore and restore-on-throw.
  • Integration: pnpm --filter @webchain/companion test:integration with Chromium. Login page served over loopback; typed and attribute secrets must not appear in the snapshot payload.
Open in Web View Automation 

Playwright ariaSnapshot and page.content include input[type=password]
values, leaking secrets into companion HTTP and MCP tool results.

Co-authored-by: esadrianno <esadrianno@gmail.com>
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