Skip to content

fix(browser): honor same-origin iframe WebMCP restrictions - #4111

Merged
reachjalil merged 2 commits into
devfrom
feature/webmcp-browser-agent
Sep 10, 2026
Merged

reachjalil merged 2 commits into
devfrom
feature/webmcp-browser-agent

Conversation

@reachjalil

@reachjalil reachjalil commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Current scope

This PR is reconstructed on current dev, not a replay of the historical WebMCP feature branch. The core feature and the separate callback-result disclosure gate already landed in #4468. The old direct-result return path, obsolete frame lookup, and retired test inventory are not restored.

Remaining fixes

  • Honor explicit iframe tools restrictions even when parent and child have the same origin. An explicit allow="tools 'none'" now wins over default same-origin access, including through ancestor containers. Unreadable container policy fails closed; ordinary same-origin access without a directive remains allowed.
  • Extend the existing frame-policy unit tests and the frame-delegation step in webmcp-browser-agent.e2e.test.ts. The fixture distinguishes an explicitly denied same-origin frame from an allowed sibling and witnesses callback execution and separate result sharing.
  • Register the existing preload, host, and frame-policy security suites in the full desktop test command, retaining feat(desktop): close and reopen focused browser tabs with shortcuts #4836's shortcut test registration and the current core/extended split.
  • Correct takeover documentation: address bar, Back, Forward and Reload permit manual navigation; webpage mouse/key input does not.

Review reconciliation

Verification

Verdict: Incomplete — exact-head native runtime evidence remains missing.

Current head: fa3ce1587f6ad570022a7fb6a75da4f4c01e0e38, based on dev@23143497940c871bda4a9aaebb82bd86c3f95530.

Passed:

  • node --import ../webmcp-frame-policy-test-resolver.mjs --test apps/desktop/electron/browser-content-preload.test.cjs apps/desktop/electron/webmcp-host.test.mjs apps/desktop/electron/webmcp-policy.test.mjs — exit 0; 28 passed, 0 failed, 0 skipped. The local resolver uses installed Electron and AJV packages; no product implementation is substituted. Omit --import in a normally installed workspace. The first setup attempts failed to resolve Electron; correcting dependency resolution produced this passing run.
  • node --test apps/desktop/electron/webmcp-policy.test.mjs — the two new regressions failed against the unchanged implementation (5 pass / 2 fail), then all seven passed with the fix.
  • node --check evals/packages/env/src/browser-fixture.ts and node --check evals/specs/webmcp-browser-agent.e2e.test.ts — exit 0; syntax checks only, not typechecking or Chromium execution.
  • git diff --check origin/dev...HEAD — exit 0.

Deferred: the extended real Electron journey, embedded fixture-script execution, and whole-package typechecks. The covering runtime command remains pnpm evals:e2e webmcp-browser-agent; no new native runtime verdict or evidence publication is claimed.

@vercel

vercel Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 10, 2026 7:48pm UTC
openwork-den Ready Ready Preview Sep 10, 2026 7:48pm UTC
openwork-den-worker-proxy Ready Ready Preview Sep 10, 2026 7:48pm UTC
openwork-diagnostics Ready Ready Preview Sep 10, 2026 7:48pm UTC
openwork-landing Ready Ready Preview, v0 Sep 10, 2026 7:48pm UTC

@reachjalil

reachjalil commented Aug 26, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit fa3ce1587f6ad570022a7fb6a75da4f4c01e0e38 · selected evidence

Open review report

Comment thread apps/desktop/electron/webmcp-policy.mjs Resolved
Comment thread apps/desktop/electron/webmcp-host.mjs Resolved
Comment thread apps/desktop/electron/webmcp-policy.mjs Resolved
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: 085b055
Status: ✅  Deploy successful!
Preview URL: https://e8e55c3e.openwork.pages.dev
Branch Preview URL: https://feature-webmcp-browser-agent.openwork.pages.dev

View logs

@vercel
vercel Bot temporarily deployed to Preview – openwork-app September 5, 2026 19:55 Inactive
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-diagnostics with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-den with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project openwork-landing with the following error:

Too many requests - try again in 5 minutes (more than 120, code: "api-deployments-flood-pro").

Learn More: https://vercel.com/docs/limits#rate-limits

@github-actions

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (64638 ms), confidentiality-review (68645 ms), spec-provenance-review (75560 ms), desktop-den-sync-review (70947 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 0 of 5 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 5 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 5/5 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (fa3ce1587f6ad570022a7fb6a75da4f4c01e0e38). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit 3e5e884 into dev Sep 10, 2026
28 checks passed

This branch was successfully deployed

4 active deployments
Preview – openwork-den — fa3ce158 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-landing — fa3ce158 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-app — fa3ce158 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — fa3ce158 Deployed Sep 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants