GHSA-4rj4-rcrq-gr92: Safari MCP: JavaScript injection through single-quoted tool arguments (backslash not escaped)
Impact Sixteen places in safari.js placed a tool argument inside a single-quoted JavaScript string literal and escaped the single quote without first escaping backslashes. An argument containing a backslash followed by a quote therefore closed the literal, and the rest of the argument ran as JavaScript in the page.
Published Nov 19, 2026
Affected packages
safari-mcp
- Ecosystem
- npm
- Affected
- < 2.22.15
- Fixed in
- 2.22.15
- Check
npm ls safari-mcp
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
Sixteen places in safari.js placed a tool argument inside a single-quoted JavaScript string literal and escaped the single quote without first escaping backslashes. An argument containing a backslash followed by a quote therefore closed the literal, and the rest of the argument ran as JavaScript in the page.
Seven of the affected arguments belong to read-only tools that are exempt from the tab-ownership check: filter in safari_network_details and safari_extract_links, level in safari_console_filter, selector in safari_snapshot, safari_accessibility_snapshot and safari_extract_tables, and dbName / storeName in safari_get_indexed_db. An MCP client limited to read-only tools (with safari_evaluate and safari_run_script excluded from its allowlist) could still run arbitrary page JavaScript through them, including in a tab the session does not own. The other affected arguments are ref in safari_select_option, safari_react_select_set and safari_react_select_list_options, the key in safari_press_key, the file name in safari_upload_file and safari_paste_image, and the first line of the text in safari_replace_editor.
Patches
Fixed in 2.22.15: every affected site uses the shared escJsSingleQuote, which escapes the backslash before the quote, and a test fails the build if a quote-only escape returns.
Workarounds
Upgrade to 2.22.15. There is no configuration workaround: excluding safari_evaluate and safari_run_script from a client's tool list did not prevent the injection.
Credits
Reported privately on 2026-10-09 by Aliaksandr Palei (@fakepooh) under the coordinated-disclosure process in SECURITY.md.
Credited to fakepooh.
References
- https://github.com/achiya-automation/safari-mcp/security/advisories/GHSA-4rj4-rcrq-gr92
- https://github.com/achiya-automation/safari-mcp/commit/23f1319defefd2c5cbd06b23189ab01876a8c5d3
- https://github.com/achiya-automation/safari-mcp/releases/tag/v2.22.15
- https://github.com/advisories/GHSA-4rj4-rcrq-gr92
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Other MCP servers and tools vulnerabilities
All Other MCP servers and tools entriesCVE-2026-77312
Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)
critical10.0Nov 20, 2026CVE-2026-77318
Jupyter MCP Server: Unauthenticated management routes can hijack the Jupyter backend in standalone HTTP mode
high7.3Nov 20, 2026CVE-2026-77359
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
critical9.3Nov 20, 2026CVE-2026-130007
k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution
high7.9Nov 19, 2026CVE-2026-130008
sqlite-mcp: Read-only mode bypass via statement chaining and SQL injection in describe_table
high8.2Nov 19, 2026CVE-2026-62964
Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution
high7.8Nov 19, 2026
