browser_evaluate
on npm:@playwright/mcp@0.0.75
Severity
2 findings on this tool
- criticalexcessive agencyf-r7-browser_evaluate
Tool `browser_evaluate` exposes a code/command execution surface
`browser_evaluate` looks like it executes code or shell commands (Evaluate JavaScript expression on page or element). Arbitrary execution is the maximal authority a tool can hold -- it subsumes every other caveat, so it should never be exposed to an agent without a hard sandbox and an explicit, narrowly-scoped capability.
fix: Do not expose raw code/shell execution to an agent. If unavoidable, run it in a disposable sandbox with no network + no host FS, gate it behind a capframe-bind capability scoped to an allow-list of commands, and require holder-of-key proof per call.
OWASP LLM08NIST MANAGE-2.2ATLAS T0051 - mediumunconstrained inputf-r1-browser_evaluate
Tool `browser_evaluate` accepts unconstrained string input
The following string parameter(s) have no `maxLength` constraint: `element`, `filename`, `function`, `target`. Unbounded strings let an attacker stuff arbitrary payloads through the tool, including indirect-injection content.
fix: Add a `maxLength` to each string property, or constrain with an `enum` or `pattern`. Most legitimate tool inputs fit under a few hundred bytes.
OWASP LLM01NIST MEASURE-2.3ATLAS T0051
About this tool
browser_evaluate is one of 23 tools exposed by Playwright MCP. The server scored 40/100 overall against the capframe rule engine (source: sandbox). Last scanned 2026-06-05.
The findings above are emitted by the public capframe.findings.v1 schema. Disagree with one? Open an issue.