playwright_mcp
- Type
- MCP server
- Scanned
- Nov 17, 2026
- Version
- 9f7d777ed841
- Files read
- 332
This tool gives AI assistants and an optional local web interface control over a custom Firefox browser to visit websites, click, type, take screenshots, and read pages. Its biggest risks are that a malicious webpage could trick the AI into reading private files on your computer, starting it in an untrusted folder automatically loads settings from any local .env file, and its optional local web interface has no login protection against other websites you visit.
What it can reach
- Browser
- Launches and controls up to two custom Firefox browsers to visit pages, click, type, upload files, capture screenshots and live video frames, run JavaScript on pages, and save cookies or logins in browser profiles.
- Files
- Reads any .env file in the current folder at startup, reads local files and folders opened via file:// links or chosen for uploads, and saves chat history, session records, browser profiles, and downloaded browser files on disk.
- Network
- Connects to any website (optionally through a proxy), downloads the custom Firefox browser, a GeoIP database, and a launch-counter file from GitHub, sends prompts and page text to OpenRouter in web interface mode, and opens local network ports (8765 and 8766).
- Secrets
- Reads your OpenRouter API key and proxy login details from command flags, environment variables, or a local .env file, and can access saved cookies and active logins inside any browser profile it opens.
- Shell commands
- Starts background Python server and Firefox processes, runs unpinned packages via uvx when configured as a plugin, and includes setup instructions telling AI assistants to run remote terminal or PowerShell install scripts.
Findings
-
HighAutomatic .env loading from current working directory injects arbitrary environment variables into MCP server
src/invisible_playwright_mcp/cli.py:52
At startup, cli.main() calls load_env_file() unconditionally, even when running as a stdio MCP server spawned by an AI coding agent inside a project folder, and writes every unset variable from ./ .env into os.environ (removing only OPENROUTER_API_KEY). Opening an untrusted repository that contains a tracked .env file lets that repository set variables such as STEALTHFOX_BINARY with INVISIBLE_SEAL_FILE or LD_PRELOAD (inherited by the Firefox subprocess) to run arbitrary code, INVISIBLE_MCP_UPLOAD_DIRS to turn on local file uploads, STEALTHFOX_PROXY to route browser traffic through an attacker proxy, or STEALTHFOX_MCP_TRANSPORT=http with STEALTHFOX_MCP_HOST=0.0.0.0 to open a network listener.
Fix: Skip reading .env from the working directory when serving MCP over stdio, and restrict .env loading in standalone UI mode to an explicit allowlist of safe settings such as OPENROUTER_API_KEY and INVISIBLE_MCP_MODEL.
-
HighArbitrary local file and directory read via file:// URLs in browser_navigate
src/invisible_playwright_mcp/mcp/actions.py:78
Although browser_upload_files is off by default and blocks hidden folders (.ssh, .env, .git) because untrusted web pages can steer the model, browser_navigate passes any URL scheme directly to page.goto(). A malicious webpage using prompt injection can trick the agent into opening file:// or view-source:file:// URLs to list local directories and read sensitive files on disk (such as .env files or SSH keys) with browser_read_text, then send their contents out by navigating to an attacker URL.
Fix: Validate the URL scheme in navigate() and allow only http:// and https:// (plus about:blank) unless local file browsing is explicitly enabled by a host-side setting.
-
MediumUnprotected local web UI allows cross-site request forgery and DNS rebinding
src/invisible_playwright_mcp/routes.py:175
When the user runs invisible-playwright-mcp ui, the local web server on 127.0.0.1:8765 has no password or token check, no Origin header check on POST routes, no Content-Type check before parsing JSON bodies, and no Host header check. Any website the user visits in their everyday browser can send a cross-origin POST request to /chat/send to give the browser agent arbitrary instructions (using the user's OpenRouter credits and any logged-in browser profile) or to /sessions/forget to delete sessions, and can use DNS rebinding to view live browser screenshots (/live/frame) and chat history (/chat/events).
Fix: Require an authentication token on all routes, enforce TrustedHostMiddleware for 127.0.0.1/localhost to block DNS rebinding, and reject POST requests whose Origin header does not match the local UI origin or whose Content-Type is not application/json.
-
Mediumbrowser_open lets prompt-injected tool calls access arbitrary profile paths and override proxy settings
src/invisible_playwright_mcp/mcp/plan.py:155
The browser_open tool exposes unconstrained profile and proxy arguments directly to the AI model, overriding host environment settings. Because _resolve_profile accepts any path on disk, a prompt-injected agent can point profile at the user's personal desktop Firefox profile directory (when Firefox is closed) to access saved cookies and logins or write profile files into arbitrary writable folders; it can also pass proxy="" to bypass a user's configured STEALTHFOX_PROXY (exposing their real IP) or route a persistent profile through an attacker-controlled proxy.
Fix: Confine tool-supplied profile names to a dedicated subdirectory inside INVISIBLE_MCP_HOME (reserving arbitrary filesystem paths for STEALTHFOX_PROFILE_DIR), and prevent tool arguments from disabling or changing a host-configured proxy unless explicitly permitted.
-
LowOptional HTTP MCP transport runs without authentication
src/invisible_playwright_mcp/mcp/server.py:750
When STEALTHFOX_MCP_TRANSPORT is set to http or streamable-http, the MCP server listens on port 8766 (and honors STEALTHFOX_MCP_HOST for non-loopback binding) with no authentication token configured, and the mcp>=1.8 dependency floor permits early SDK versions without DNS rebinding or Origin checks. Anyone able to reach the bound port, or a website exploiting older SDK versions on loopback, can drive the browser tools directly.
Fix: Require bearer token authentication when running the HTTP transport, especially when STEALTHFOX_MCP_HOST is not loopback, and raise the mcp dependency floor to a version that enforces Host and Origin checks on loopback.
-
LowBundled setup skill instructs agents to execute unpinned remote install scripts
The setup skill shipped in the plugin tells the coding agent to install uv by piping unpinned scripts directly from https://astral.sh/uv/install.sh into sh (or install.ps1 into PowerShell with -ExecutionPolicy ByPass) and to run uvx invisible-playwright fetch without a version pin.
Fix: Check whether uvx is already installed before running an installer, and pin installer versions and checksums rather than piping unpinned remote scripts directly into a shell.
-
LowOpenAI SDK environment headers can leak to OpenRouter or override Authorization
src/invisible_playwright_mcp/llm.py:38
make_client constructs openai.OpenAI pointed at https://openrouter.ai/api/v1 without clearing OpenAI-specific environment defaults. If the user has OPENAI_ORG_ID, OPENAI_PROJECT_ID, or OPENAI_CUSTOM_HEADERS set in their shell or .env, the SDK automatically attaches those headers to every request sent to OpenRouter, leaking unrelated OpenAI metadata or overriding the Authorization header.
Fix: Pass organization=None, project=None, and explicit Authorization or Omit() values in default_headers when constructing the OpenAI client for OpenRouter.
