Skip to content

fix(browser): keep guarded CDP sockets on validated endpoints [AI] - #114506

Merged
pgondhi987 merged 14 commits into
openclaw:mainfrom
pgondhi987:fix/fix-870-current-2
Aug 12, 2026
Merged

pgondhi987 merged 14 commits into
openclaw:mainfrom
pgondhi987:fix/fix-870-current-2

Conversation

@pgondhi987

Copy link
Copy Markdown
Contributor

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.ts passed: 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.ts passed: 4 files, 92 tests.
  • git diff --check passed.

AI-assisted: yes.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL maintainer Maintainer-authored PR labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 5:14 AM ET / 09:14 UTC.

ClawSweeper review

What this changes

This 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
Reviewed head: cde75f158a2ef7d1f5f4d5f38826a20b11794691
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 6 items Current-main defect: The validator resolves a pinned hostname but returns void, while the Playwright connection later receives only the URL; a later DNS lookup can therefore differ from the validated resolution.
Pinned lookup contract: The shared SSRF owner returns both approved addresses and a Node DNS lookup callback, which is the fact the branch must carry to the transport sink.
Branch owner-boundary repair: The branch retains the validation result and selects a custom transport when a lookup is available, so the repair is located at the Browser connection owner rather than downstream callers.
Findings None None.
Security Needs attention Verify the custom transport against installed Playwright: The branch invokes Playwright through a custom transport, but its focused test mocks the dependency method; run it against the pinned runtime before treating the socket-boundary guarantee as established.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should restrictive Browser SSRF policy fail closed for existing-session Chrome MCP profiles that specify a CDP endpoint until Chrome MCP can preserve OpenClaw’s validated lookup? Prove and retain fail-close: Run an exact-head installed-Playwright transport proof, then accept the documented regular-driver or host-local Chrome MCP migration path.

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

  • Resolve security concern: Verify the custom transport against installed Playwright - The branch invokes Playwright through a custom transport, but its focused test mocks the dependency method; run it against the pinned runtime before treating the socket-boundary guarantee as established.
  • Resolve merge risk (P1) - Existing Chrome MCP existing-session profiles with explicit CDP endpoints will stop under the default restrictive policy unless maintainers accept the documented driver/profile migration.
  • Resolve merge risk (P1) - The custom transport replaces Playwright's normal URL path, but current exact-head evidence mocks the dependency method rather than exercising installed playwright-core.
  • Resolve merge risk (P1) - The bug fix adds roughly 565 net production lines across security-sensitive Browser transport and upload paths; maintainers need a clear owner-boundary justification for that growth.
  • Complete next step (P2) - A maintainer must choose the Chrome MCP compatibility policy; contributor proof must then exercise installed Playwright on the exact head.
  • Improve patch quality - Resolve the security review concern or explain why the changed path is safe.

Findings

  • [medium] Verify the custom transport against installed Playwright — extensions/browser/src/browser/pw-session-cdp-transport.ts:133
Agent review details

Security

Needs 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 surface

Source +566, Tests +1414, Docs +15. Total +1995 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 27 977 411 +566
Tests 23 1514 100 +1414
Docs 1 15 0 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 51 2506 511 +1995

Review metrics

Metric Value Why it matters
Production versus test delta production +974/-409 (net +565); tests/support +1517/-102 (net +1415); docs +15/-0 The security fix substantially grows the Browser transport surface, so its owner-boundary justification and real-runtime proof matter before merge.

Stored data model

Persistent data-model change detected: serialized state: extensions/browser/src/browser/chrome.test.ts, serialized state: extensions/browser/src/browser/pw-tools-core.interactions.content.ts, serialized state: extensions/browser/src/browser/pw-tools-core.interactions.set-input-files.test.ts, serialized state: extensions/browser/src/browser/server-context.remote-profile-tab-ops.fallback.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Validate the real transport before merging (recommended)
    Exercise the exact head against installed playwright-core with a pinned local CDP server, including allowed traffic and an authority-changing redirect, then record redacted after-fix output and the owner decision.
  2. Accept the documented Chrome MCP break
    Explicitly accept that restrictive-policy existing-session profiles with explicit endpoints must migrate to the regular driver or host-local attachment.
  3. Pause for an equivalent Chrome MCP boundary
    Do not merge until Chrome MCP can preserve the validated lookup without the compatibility break.

Technical review

Best 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 extensions/browser/src/browser/cdp.helpers.ts:146 but returns no value, and extensions/browser/src/browser/pw-session-connection.ts:396 later connects by URL.

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.

Labels

Label justifications:

  • P1: This addresses a current Browser SSRF boundary while changing behavior for existing strict-policy Chrome MCP setups.
  • merge-risk: 🚨 compatibility: Explicit-endpoint existing-session profiles fail closed under the default restrictive Browser policy after merge.
  • merge-risk: 🚨 security-boundary: The patch changes SSRF validation, DNS pinning, redirects, and the final CDP socket transport.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

Security concerns:

  • [medium] Verify the custom transport against installed Playwright — extensions/browser/src/browser/pw-session-cdp-transport.ts:133
    The branch invokes Playwright through a custom transport, but its focused test mocks the dependency method; run it against the pinned runtime before treating the socket-boundary guarantee as established.
    Confidence: 0.9

What I checked:

Likely related people:

  • steipete: Peter Steinberger accounts for most recorded history of the Browser CDP connection path, including the managed-proxy handshake repair. (role: feature-history owner; confidence: high; commits: 44bcaa263c7a, b0376d19bf6f, aba0b12014a; files: extensions/browser/src/browser/pw-session-connection.ts, extensions/browser/src/browser/cdp.helpers.ts, extensions/browser/src/browser/chrome.ts)
  • Vyctor H. Brzezowski: Current-main blame for the validation and connection-wrapper lines points to the recent Browser refactor. (role: recent area contributor; confidence: medium; commits: 7e4c7f0ea75c; files: extensions/browser/src/browser/pw-session-connection.ts, extensions/browser/src/browser/cdp.helpers.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (26 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T20:19:17.655Z sha 487d9c4 :: found issues before merge. :: [P2] Validate the 50 MB cap for each upload payload
  • reviewed 2026-08-02T06:25:10.518Z sha 487d9c4 :: found issues before merge. :: [P2] Validate the 50 MB cap for each upload payload
  • reviewed 2026-08-02T13:16:32.334Z sha 487d9c4 :: found issues before merge. :: [P2] Apply the 50 MiB cap to each buffered upload file
  • reviewed 2026-08-03T07:46:53.442Z sha 487d9c4 :: found issues before merge. :: [P2] Validate the 50 MiB cap per buffered upload file
  • reviewed 2026-08-06T06:36:08.053Z sha 4c8a300 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-10T10:48:25.542Z sha 8663b9d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-10T11:59:39.490Z sha 55f54d7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-11T20:09:46.899Z sha 6c4713d :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 27, 2026
@pgondhi987
pgondhi987 force-pushed the fix/fix-870-current-2 branch 3 times, most recently from eaacf48 to e7b37dd Compare July 27, 2026 13:49
@openclaw-barnacle openclaw-barnacle Bot removed extensions: memory-core Extension: memory-core cli CLI command changes extensions: oc-path labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 11, 2026
@pgondhi987
pgondhi987 merged commit 92f5f07 into openclaw:main Aug 12, 2026
29 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 13, 2026
…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
steipete added a commit that referenced this pull request Aug 13, 2026
* 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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: browser maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant