Skip to content

fix(runtime): block file and internal navigate targets - #16

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-478d
Draft

fix(runtime): block file and internal navigate targets#16
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-478d

Conversation

@cursor

@cursor cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Blocks file://, localhost, and private-network navigate URLs before Playwright navigation.

Bug and impact

Any MCP/companion caller could navigate to file:///etc/passwd or internal HTTP endpoints and exfiltrate page content via snapshot.

Root cause

NavigateCommandSchema only validated z.string().url() with no scheme or host policy.

Fix and validation

  • Added assertAllowedNavigateUrl (http/https public hosts only).
  • Enforced in Zod schema and BrowserRuntime.navigate.
  • Added unit tests in @webchain/protocol.
  • pnpm --filter @webchain/protocol test and pnpm --filter @webchain/runtime test
Open in Web View Automation 

Restrict navigate URLs to public http/https hosts to prevent local file
reads and SSRF via snapshot exfiltration.

Co-authored-by: esadrianno <esadrianno@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant