Skip to content

Conversation

sakupi01
Copy link

@sakupi01 sakupi01 commented Oct 1, 2025

This PR adds URL validation functionality to restrict Puppeteer browser navigation to allowed origins.

  • UrlValidator class with allowlist/denylist support using glob patterns
  • CLI options (--allowedOrigins, --deniedOrigins) to configure URL filtering
  • Request interception to block navigation to specific URLs

Motivation

When adopting browser automation MCPs in a corporate environment, it can be a good reason for adoption to restrict accessible origins to deal with security concerns. Flagging on which domains the MCP server can access (e.g. localhost only) prevents unintended navigation to unauthorized or potentially malicious sites while
maintaining safe internal tool usage.

Copy link

google-cla bot commented Oct 1, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@sakupi01 sakupi01 marked this pull request as ready for review October 1, 2025 04:05
"puppeteer-core": "24.22.3",
"yargs": "18.0.0"
"yargs": "18.0.0",
"zod": "3.24.1"
Copy link
Author

Choose a reason for hiding this comment

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

Build failed in local without zod, so I added. (I wonder if others don't have this issue.)

@OrKoN
Copy link
Collaborator

OrKoN commented Oct 1, 2025

Thanks for the PR. We will review it once we are sure we want to use request interception for this. Request interception has a bunch of drawbacks. Could you please file an issue describing your use case instead so that we can collect the feedback from other users as well?

@sakupi01
Copy link
Author

sakupi01 commented Oct 1, 2025

@OrKoN

Thank you for taking this into account!
Here's a detailed motivation of the PR: #239

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.

2 participants