Repository navigation
fix(browser): enforce strict redirect policy for Chrome MCP navigation - #191271
Conversation
…spection Chrome MCP (existing-session) navigation dispatches through opaque navigate_page/new_page tool calls, so redirect hops reach Chrome's network stack before OpenClaw can check the final URL. Under an explicit strict browser SSRF policy, refuse http(s) navigation and tab opens on that transport, matching the existing raw CDP fallback gate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
ClawSweeper reviewReviewed November 3, 2026, 7:16 AM UTC. What this changesThis PR rejects strict-policy HTTP(S) navigation and tab creation through Chrome MCP before browser dispatch. PR surface: Source +17, Tests +30. Total +47 across 6 files. Merge readinessResult: ready for maintainer review. Overall: 🐚 platinum hermit Reviewed head: Review scores
VerificationStatus: sufficient How this fits togetherThe Browser plugin accepts navigation and tab-open requests, applies the configured destination policy, and dispatches permitted operations through Playwright or Chrome MCP. flowchart TD
A[Browser request] --> B[Navigation or tab owner]
B --> C[Shared navigation policy]
C --> D[Strict Chrome MCP rejection]
C --> E[Permitted MCP operation]
E --> F[Chromium network]
F --> G[Result URL validation]
Before merge
Review detailsBest possible solution: Retain the shared preflight at both Chrome MCP entry points, preserving about:blank and the existing non-strict policy modes. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the initial-check, opaque MCP dispatch, and post-result-check sequence; the supplied real-browser proof exercises the repaired boundary, but this read-only review ran no target code. Is this the best way to solve the issue? The fix reuses the existing strict redirect-inspection predicate and navigation-policy owner without adding state, configuration, or a competing enforcement path. AGENTS.md: found_applied Codex review notes: model internal, reasoning medium; reviewed against 5918b1d. Label detailsLabel justifications:
Evidence reviewedPR surface:
|
|
Behavior proof for The authenticated production browser bridge ran on Linux/Node 24.20.0 with an isolated real Chromium 148 session and packaged Chrome DevTools MCP 1.12.0. No browser, MCP, DNS, HTTP or policy adapter was mocked. A transparent stdio recorder counted actual tool names; local servers counted redirect and protected-endpoint requests.
Limits: real browser bridge/MCP/Chromium source-checkout proof; no full Gateway/model flow or installed-package upgrade. No configuration reader, updater, migration, data schema or profile format changes. Package-local SDK declaration resolution was unavailable; the extension-wide typecheck passed. Compatibility: strict-mode existing-session profiles refuse HTTP(S) navigation and new tabs; use driver |
|
Verification before merge: Head: The focused browser fix rejects strict-policy HTTP(S) navigation and tab creation before Chrome MCP dispatch because that transport cannot inspect redirect hops. Exact-head independent local review reached Platinum overall, Diamond for the patch, with sufficient real behavior proof, cleared security, and no findings or outstanding maintainer decision. Optional additional reviewers were disabled. On Linux/Node 24.20.0, Chromium 148 and packaged Chrome DevTools MCP 1.12.0, the authenticated production bridge returned 400 for both strict HTTP routes, with zero navigation/tab-opening MCP calls and zero redirect/protected-endpoint requests. Real Commands and results:
Final informational CI snapshot: 43 successful, 72 skipped, 2 cancelled, zero failed or pending checks. Both cancelled entries are Auto response jobs cancelled before any step; neither exercises the changed browser code. No CI repair was needed. Limits: source-checkout browser bridge/MCP/Chromium proof, without a full Gateway/model flow or installed-package upgrade. No updater, migration, data-schema or profile-format changes. Package-local SDK declarations were unavailable; extension-wide typechecking passed. Regression risk is limited to the two guarded dispatch paths. Intended user behavior change: strict existing-session profiles now reject HTTP(S) navigation and tab opens; use driver |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR blocks HTTP(S) navigation and tab opening through Chrome MCP when strict redirect inspection is required. Example: An existing-session profile with dangerouslyAllowPrivateNetwork explicitly false opens http://93.184.216.34/redirect.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR closes a current strict-policy enforcement gap with a focused change and supplied real-browser proof; no introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Browser plugin receives navigation and tab-open requests, applies destination policy, and dispatches permitted operations through Playwright or Chrome MCP. flowchart TD
A[Browser HTTP request] --> B[Navigation or tab owner]
B --> C[Shared navigation policy]
C --> D[Reject strict MCP network operation]
C --> E[Permit supported operation]
E --> F[Chrome MCP and Chromium]
F --> G[Validate result URL]
Technical reviewBest possible solution: Retain the shared preflight at both Chrome MCP dispatch boundaries while preserving about:blank and existing non-strict modes. Do we have a high-confidence way to reproduce the issue? Current-main source exposes opaque MCP dispatch between initial and final URL checks, establishing the enforcement gap; this read-only review inspected supplied after-fix evidence without running target code. Is this the best way to solve the issue? The patch is a small complete fix for these two entry points because it reuses the existing policy owner and redirect-inspection predicate without adding state or parallel enforcement machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against df80ba7a66a7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +17, Tests +30, Docs 0. Total +47 across 6 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 3, 2026, 8:15 AM ET / 13:15 UTC. |
…spection (openclaw#191271) Chrome MCP (existing-session) navigation dispatches through opaque navigate_page/new_page tool calls, so redirect hops reach Chrome's network stack before OpenClaw can check the final URL. Under an explicit strict browser SSRF policy, refuse http(s) navigation and tab opens on that transport, matching the existing raw CDP fallback gate. Co-authored-by: Claude Opus 5.5 <[email protected]>
…spection (#191271) Chrome MCP (existing-session) navigation dispatches through opaque navigate_page/new_page tool calls, so redirect hops reach Chrome's network stack before OpenClaw can check the final URL. Under an explicit strict browser SSRF policy, refuse http(s) navigation and tab opens on that transport, matching the existing raw CDP fallback gate. Co-authored-by: Claude Opus 5.5 <[email protected]> Backport-source: 0e7aab7 Backport-scope: Use a dedicated preflight for Chrome MCP navigate/new-page that rejects network navigation requiring inspectable redirects. Retain initial validation, post-navigation guard, currentness and non-strict/about:blank behavior. Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: strict browser SSRF policy cannot inspect redirect hops when navigation or a new tab uses an existing-session Chrome MCP profile.
User Impact
When
browser.ssrfPolicy.dangerouslyAllowPrivateNetworkis explicitlyfalse, existing-session profiles now reject HTTP(S) navigation and tab opens before sending a Chrome MCP command. Use a profile with driveropenclawfor strict navigation.about:blankremains available, and other policy modes retain their existing behavior.Why This Change Was Made
Reuse the browser navigation policy owner for a shared Chrome MCP preflight at both entry points. This applies the existing requirement for redirect inspection to a transport that cannot provide it. The added guard is needed at these two dispatch boundaries; no new configuration or state is introduced.
Evidence
Validated head:
d3a9b11d11d21a6b51b7e4004c0e9a781f8452bd.The five focused browser suites passed 180 tests. Both added regressions failed against base production code and passed with this fix. Focused lint, formatting, extension-wide typecheck, and
git diff --checkpassed.pnpm test extensions/browser/src/browser/server-context.existing-session.test.ts extensions/browser/src/browser/server.agent-contract-core.test.ts extensions/browser/src/browser/routes/agent.existing-session.test.ts extensions/browser/src/browser/routes/agent.snapshot.local-managed.test.ts extensions/browser/src/browser/routes/tabs.test.tsReal Behavior Proof
Executed the authenticated production browser bridge HTTP routes with a real isolated Chromium 148 session and the packaged
chrome-devtools-mcp1.12.0 subprocess on Linux/Node 24.20.0. No browser, MCP, DNS, HTTP, or policy adapter was mocked. A transparent stdio recorder forwarded the actual messages unchanged and counted only MCP tool names. Two local HTTP servers counted redirect and protected-destination requests.The fixture's loopback host was explicitly listed in
allowedHostnames, so destination checks allowed the controlled target while strict redirect inspection remained required. This prevents an unrelated private-address rejection from satisfying the test. The exact same redirect URL was then exercised with private-network permission explicitly enabled as the positive control.POST /navigatePOST /tabs/openabout:blanktabnew_pagecallnavigate_pagecallThe persisted profile and SSRF-policy configuration remained byte-for-byte unchanged. The diff changes no configuration reader, data schema, updater, migration, or profile format. Limits: this proves the production browser bridge, MCP subprocess and Chromium boundary in a source checkout; it does not claim a full Gateway/model flow or installed-package upgrade. Package-local SDK declaration resolution was unavailable; the extension-wide typecheck passed with zero errors.
Save the following harness outside the checkout as
/tmp/browser-real-mcp-proof.mts, setCHROME_BINto an available Chromium executable, and run from the clean checkout at the validated head:CHROME_BIN=/path/to/chromium pnpm exec tsx --tsconfig tsconfig.json /tmp/browser-real-mcp-proof.mtsComplete real-browser reproduction harness