Safari MCP: JavaScript injection through single-quoted tool arguments (backslash not escaped)
Affects safari-mcpSource GCVE Database
CVSS 6.2 Medium : upgrade to 2.22.15 when convenient.
Data as of 19 Nov 2026, 23:07 UTC
- Patch
- Available – fixed in 2.22.15
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:NWhat to do
Upgrade safari-mcp to 2.22.15.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmsafari-mcp | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade safari-mcp to version 2.22.15 or later, where the vulnerability is fixed by proper escaping of backslashes in single-quoted JavaScript strings. There is no configuration workaround; excluding certain tools from the allowlist does not prevent exploitation. Applying the official patch is the only effective mitigation.
Description
A JavaScript injection vulnerability exists in safari-mcp versions prior to 2.22.15 due to improper escaping of backslashes in single-quoted JavaScript string literals in multiple tool arguments. This flaw allows an attacker to inject arbitrary JavaScript code in the page context, including in tabs not owned by the session, even when limited to read-only tools. The issue is fixed in version 2.22.15 by properly escaping backslashes before quotes.
References
- github.com/achiya-automation/safari-mcp/security/advisories/GHSA-4rj4-rcrq-gr92 (opens in a new tab)
- github.com/achiya-automation/safari-mcp/commit/23f1319defefd2c5cbd06b23189ab01876a8c5d3 (opens in a new tab)
- github.com/achiya-automation/safari-mcp (opens in a new tab)
- github.com/achiya-automation/safari-mcp/releases/tag/v2.22.15 (opens in a new tab)