Skip to content
FlawDB
Sign in

GHSA-4rj4-rcrq-gr92

MEDIUM 6.2

Safari MCP: JavaScript injection through single-quoted tool arguments (backslash not escaped)

Mitigation

  • Upgrade safari-mcp to 2.22.15 or later.

Who should check

  • Projects that depend on npm package safari-mcp (< 2.22.15)

Vulnerability facts

Affected
safari-mcp < 2.22.15
Fixed in
2.22.15
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
6.2 (v4.0, GitHub)CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Attack requirements: None
  • Privileges required: Low
  • User interaction: None
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: None
  • Confidentiality impact on other systems: High
  • Integrity impact on other systems: High
  • Availability impact on other systems: None
CWE
CWE-94, CWE-116
Published
Modified

Description

### 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.

Affected and fixed versions

Package / productAffectedFixedSource
npm safari-mcp< 2.22.152.22.15ghsa

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by GHSA-4rj4-rcrq-gr92. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/GHSA-4rj4-rcrq-gr92.md
Affected: safari-mcp < 2.22.15
Fixed in: 2.22.15

Steps:
1. Search this machine and project for safari-mcp (npm): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

Technologies

References

FAQ

Is GHSA-4rj4-rcrq-gr92 being exploited?

There is no confirmed exploitation: GHSA-4rj4-rcrq-gr92 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is GHSA-4rj4-rcrq-gr92?

Medium: CVSS 6.2 (v4.0, scored by GitHub). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by GHSA-4rj4-rcrq-gr92?

safari-mcp < 2.22.15.

Is there a fix for GHSA-4rj4-rcrq-gr92?

Yes. Fixed in 2.22.15. Upgrade safari-mcp to 2.22.15 or later.

How do I check if I'm affected by GHSA-4rj4-rcrq-gr92?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

See all
Vulnerabilities, newest first
SeverityIdentifier / vulnerabilityTechnologySignalsAge
MEDIUM 6.9CVE-2026-138026

Crypto APIs MCP Servers (@cryptoapis-io/mcp-*) Missing Authentication via Streamable HTTP Transport

MCP servers and SDKs+1
HIGH 7.7CVE-2026-138027

Bagel before 2.5.5 Unsandboxed DuckDB SQL Execution via query_messages

MCP servers and SDKs+1
HIGH 7.7CVE-2026-138028

Bagel before 2.5.5 Argument Injection via rsync Pipeline Task Options

MCP servers and SDKs
MEDIUM 5.3CVE-2026-138029

Wazuh-MCP-Server before commit 2bbfe12 SSRF via blueteam_check_webshell Hostname Bypass

MCP servers and SDKs
LOW 2.3CVE-2026-138030

SylphxAI pdf-reader-mcp 2.4.1 through 3.1.4 SSRF via DNS Rebinding in URL Loader

MCP servers and SDKs+1
Sponsors