Repository navigation
Stop the Bot browser e2e mistaking node ids for a leaked card code - #638
Merged
Merged
Conversation
bot-browser.spec.ts:109 flaked on #583 (run 40441401512) with tableSeen.leaked ["737"]. The check searched the whole JSON of the snapshot, and Chromium's accessibility node ids (nodeId 737, 4737, 5737...) are counters that can spell the fixture's 3-digit security code. Navigating /card-table 300 times, the old check reported a leak in 11 snapshots; every hit was a node id, never the code. The leak checks now look only at the strings a snapshot shows, skipping node ids and element refs. With the boundary's scrubbing switched off, the new check still reports 737 and the other card values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6RErv2zR8rF2mUh5aR8
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in the Bot browser E2E fixture, including the snapshot contracts and secret-masking assertions that consume its results.
- Collision-free leak detection:
leakedInscans nested string values while excluding generated node IDs and element references, avoiding accidental matches against the short card code. - Preserved secret coverage: Login masking and card-table checks retain detection in names, values, selectors, attributes, and nested accessibility source text without changing product behavior.
Validation passed: npm run type-check:e2e, ESLint for the changed file, and direct checks of the actual helper against an ID-only collision and six real-leak fixtures. The Electron spec was not run because this checkout lacks node_modules/electron/dist/electron.
gpt-6.1-sol | 𝕏
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.

Requested by sbt · project thread
What happened
tests/e2e/bot-browser.spec.ts:109flaked once on #583 (head 7138ae4, run 40441401512, macOS E2E 3/3) withtableSeen.leaked=["737"]. It passed on retry.Cause: the test, not the Bot browser
The fixture checked for leaks by searching the whole JSON of the snapshot for each secret. That JSON includes Chromium's accessibility node ids (
nodeId,parentId,childIds,backendDOMNodeId). They're counters, so the 3-digit security code737matches whenever a node gets id 737, 3737, 4737, 5737 and so on.I reproduced it by loading
/card-table300 times in the real Electron fixture. The old check reported a "leak" in 11 of the 300 snapshots (about 4%). Every hit was a node id, and the card code itself never appeared. One example hit:{"nodeId":"4737","role":"LabelText","name":""}. The longer secrets (6 or more characters, or with letters) can't collide this way.Fix
A
leakedInhelper looks only at the strings a snapshot shows, skipping node ids and element refs. Both the login masking check and the card-table check use it.scrubBrowserSnapshottemporarily switched off, the spec fails atmasking.leaked(481516,4242424242424242). The card-table check reports737(the real code, in the button's name),550071,4000123412341234and5555444433332222. So it still catches a real leak.bot-browser.spec.tspasses 4 times in a row locally (Linux, xvfb).npm run type-check:e2eand eslint are clean.The change is test-only and touches no product code or docs.
Generated by Claude Code