Media

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

  • Publicada: 19.11.2026
  • Actualizado: 20.11.2026 00:17

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.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm safari-mcp < 2.22.15 2.22.15

Referencias

Puntuación CVSS -
Vector CVSS
CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
Debilidad (CWE)
CWE-116, CWE-94
Plataforma
npm
Paquete
safari-mcp
Publicada
19.11.2026
Actualizado
20.11.2026 00:17

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-4rj4-rcrq-gr92 - CC BY 4.0

Historial de vulnerabilidades: safari-mcp

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Esta es la única vulnerabilidad conocida de este paquete.

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.