Saltar al contenido
DayZeroHub
Media Sin redactarCVSS 6.2GHSA-4rj4-rcrq-gr92

GHSA-4rj4-rcrq-gr92: Safari MCP: JavaScript injection through single-quoted tool arguments (backslash not escaped)

safari-mcp

Aviso preliminar: se publicó de inmediato con los datos originales de las fuentes, sin redacción editorial. En breve se reemplaza por una versión redactada y revisada.

Resumen

GHSA-4rj4-rcrq-gr92: vulnerabilidad de severidad media (CVSS 6.2) en safari-mcp.

Qué ocurre

Descripción original de la fuente (en inglés): ### 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.

Por qué importa

Severidad media, CVSS 6.2.

Productos y versiones afectados

safari-mcp < 2.22.15 (corregido en 2.22.15)

ProductoVersionesCorregido en
safari-mcp< 2.22.152.22.15

Acción recomendada por la fuente

Actualizar a una versión corregida: 2.22.15.

Corregido en: 2.22.15

Información tomada de la fuente o del proveedor. Verificala en el enlace original antes de actuar.

Fuentes y referencias

Debilidades (CWE): CWE-94, CWE-116

Historial de cambios relevantes

  1. Publicado

    Aviso preliminar publicado.