Repository navigation
fix(browser): keep guarded CDP sockets on validated endpoints [AI] - #114506
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 5:14 AM ET / 09:14 UTC. ClawSweeper reviewWhat this changesThis PR preserves validated CDP DNS lookups through Browser WebSocket and Playwright connections, while rejecting explicit Chrome MCP CDP endpoints that cannot retain that validation. Merge readiness⛔ Blocked by patch quality or review findings - 7 items remain Keep open: current main still validates CDP DNS but discards the resulting lookup before Playwright reconnects. The branch targets the right Browser boundary, but its current head needs actual Playwright-runtime proof and a Browser-owner decision on the intentional Chrome MCP compatibility break. Priority: P1 Review scores
Verification
How this fits togetherThe Browser plugin turns configured Chrome DevTools Protocol endpoints into discovery requests and sockets used by browser actions. SSRF validation is meant to constrain the endpoint before Playwright, direct CDP commands, snapshots, and uploads use it. flowchart LR
A[Configured CDP endpoint] --> B[SSRF and DNS validation]
B --> C[Validated lookup pin]
C --> D[Endpoint discovery]
D --> E[WebSocket or Playwright transport]
E --> F[Browser tabs and actions]
Decision needed
Why: The code can prove that Chrome MCP crosses a subprocess boundary without the pinned lookup, but it cannot choose whether preserving that existing profile shape outweighs the security boundary. Before merge
Findings
Agent review detailsSecurityNeeds attention: The intended hardening is plausible, but the new security-critical Playwright transport has not been shown working against the installed dependency at the exact head. PR surfaceSource +566, Tests +1414, Docs +15. Total +1995 across 51 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one Browser-owned pinned CDP transport, prove it against installed Playwright on the exact head, and land only after the Browser owner accepts the explicit Chrome MCP upgrade policy. Do we have a high-confidence way to reproduce the issue? Yes, from current-main source: CDP validation resolves a pin at Is this the best way to solve the issue? Unclear: carrying the lookup to the Browser transport owner is the right repair shape, but the real Playwright transport contract and the Chrome MCP upgrade policy remain unproven. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 08b7fcc05ed6. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (26 earlier review cycles; latest 8 shown)
|
eaacf48 to
e7b37dd
Compare
…penclaw#114506) * fix(browser): keep guarded CDP sockets on validated endpoints * fix(browser): avoid retrying rate-limited CDP discovery * fix(browser): close Chrome MCP CDP policy gaps * test(browser): match Chrome MCP policy error * test(browser): satisfy transport type and lint checks * fix(browser): narrow guarded CDP transport changes * fix(browser): separate upload filesystem locality * fix(browser): keep strict remote CDP hosts untrusted
* fix(docker): harden runtime image dependencies * chore(deps): update container security dependencies * docs(docker): explain image security contents * test(browser): align file-chooser and install tests with #114506 contract * test(browser): restore extension install test isolation * test(browser): add temporary CI diagnostics for pre-registration refusal * test(browser): make install fixture interpreter hermetic The suite passed process.execPath as the native-host interpreter; on GitHub-hosted runners the hostedtoolcache node binary is group/world- writable, which installChromeExtensionBootstrap correctly refuses, so every registration test failed CI-only. The fixture now provides an owned 0700 interpreter; only the launcher-exec test keeps the real node it must spawn. * fix(qa-lab): stop re-polling after a probe consumes the discovery deadline The Matrix health-probe loop re-entered when the probe timeout fired marginally before Date.now() crossed the deadline, starting a doomed extra probe. Flaked on contended CI runners as 'expected 1 fetch, got 2'. A timed-out probe now ends discovery. * test(ui): poll the callout inset invariant in device-scope E2E One-shot boundingBox reads raced the nav-collapse transition and intermittently measured a 20px stale offset on CI.
* fix(docker): harden runtime image dependencies * chore(deps): update container security dependencies * docs(docker): explain image security contents * test(browser): align file-chooser and install tests with openclaw#114506 contract * test(browser): restore extension install test isolation * test(browser): add temporary CI diagnostics for pre-registration refusal * test(browser): make install fixture interpreter hermetic The suite passed process.execPath as the native-host interpreter; on GitHub-hosted runners the hostedtoolcache node binary is group/world- writable, which installChromeExtensionBootstrap correctly refuses, so every registration test failed CI-only. The fixture now provides an owned 0700 interpreter; only the launcher-exec test keeps the real node it must spawn. * fix(qa-lab): stop re-polling after a probe consumes the discovery deadline The Matrix health-probe loop re-entered when the probe timeout fired marginally before Date.now() crossed the deadline, starting a doomed extra probe. Flaked on contended CI runners as 'expected 1 fetch, got 2'. A timed-out probe now ends discovery. * test(ui): poll the callout inset invariant in device-scope E2E One-shot boundingBox reads raced the nav-collapse transition and intermittently measured a 20px stale offset on CI.
What Problem This Solves
Fixes an issue where Browser plugin users with strict CDP endpoint controls could validate one hostname result but later open a guarded CDP WebSocket with a different hostname resolution.
Why This Change Was Made
The Browser CDP endpoint check now returns the validated hostname pin, and guarded WebSocket connections reuse that lookup when creating targets, observing committed navigation, reading snapshot identity, or closing tracked CDP targets. The change stays inside the Browser plugin CDP path and does not add configuration, storage, provider, or channel behavior.
User Impact
Strict CDP endpoint controls now keep guarded WebSocket connections on the same resolved endpoint that passed validation. Normal loopback, discovered, credentialed, direct WebSocket, default Chrome MCP endpoint attach, and guarded upload flows continue to work.
Evidence
node scripts/run-vitest.mjs extensions/browser/src/browser/cdp.helpers.internal.test.ts extensions/browser/src/browser/cdp.helpers.test.ts extensions/browser/src/browser/cdp.test.ts extensions/browser/src/browser/pw-session.connections.test.ts extensions/browser/src/browser/pw-session.termination-cdp-ssrf.test.ts extensions/browser/src/browser/pw-tools-core.interactions.set-input-files.test.ts extensions/browser/src/browser/routes/agent.snapshot.local-managed.test.ts extensions/browser/src/browser/routes/agent.snapshot.timeout.test.ts extensions/browser/src/browser/server-context.tab-selection-lookup.test.ts extensions/browser/src/browser/server-context.existing-session.test.tspassed: 10 files, 191 tests.node scripts/run-vitest.mjs extensions/browser/src/browser/pw-session.connections.test.ts extensions/browser/src/browser/server-context.existing-session.test.ts extensions/browser/src/browser/cdp.helpers.test.ts extensions/browser/src/browser/pw-tools-core.interactions.set-input-files.test.tspassed: 4 files, 92 tests.git diff --checkpassed.AI-assisted: yes.