Skip to content

fix: restrict URL schemes in page navigation to http/https#972

Closed
AI-Reviewer-QS wants to merge 1 commit intoChromeDevTools:mainfrom
AI-Reviewer-QS:fix/url-scheme-validation
Closed

fix: restrict URL schemes in page navigation to http/https#972
AI-Reviewer-QS wants to merge 1 commit intoChromeDevTools:mainfrom
AI-Reviewer-QS:fix/url-scheme-validation

Conversation

@AI-Reviewer-QS
Copy link
Copy Markdown

Summary

  • new_page and navigate_page tools pass user-provided URLs directly to page.goto() without validating the URL scheme
  • This allows navigating to potentially dangerous schemes like file://, chrome://, or data: URLs which could expose local files or internal browser state
  • Added URL scheme validation that restricts navigation to http:, https:, and about: schemes
  • Unparseable URLs are passed through to let the browser handle them (it will reject invalid ones)

Test plan

  • Verify http:// and https:// URLs work normally in new_page
  • Verify http:// and https:// URLs work normally in navigate_page
  • Verify file:// URLs are rejected with clear error message
  • Verify chrome:// URLs are rejected
  • Verify data: URLs are rejected
  • Verify about:blank still works
  • Verify back/forward/reload navigation types are unaffected

The new_page and navigate_page tools pass user-provided URLs directly to
page.goto() without validating the URL scheme. This allows navigating to
potentially dangerous schemes like file://, chrome://, or data: URLs.

Add URL scheme validation that restricts navigation to http:, https:,
and about: schemes.
@OrKoN
Copy link
Copy Markdown
Collaborator

OrKoN commented Feb 16, 2026

Thanks for the PR! Could you please file a feature request first? I think we can support all URL schemes allowed by Chrome for automation. cc @natorion @nroscino

@OrKoN OrKoN closed this Feb 16, 2026
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.

3 participants