{"id":"GHSA-4rj4-rcrq-gr92","aliases":[],"title":"Safari MCP: JavaScript injection through single-quoted tool arguments (backslash not escaped)","originalDescription":"### 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 ","severity":{"cvss":6.2,"vector":null,"label":"medium"},"exploitation":{"kev":null,"epss":null,"exploitDb":null},"affected":[{"ecosystem":"npm","name":"safari-mcp","range":"< 2.22.15","fixed":"2.22.15"},{"ecosystem":"npm","name":"safari-mcp","range":">=0, <2.22.15","fixed":"2.22.15"}],"references":[{"url":"https://github.com/achiya-automation/safari-mcp/security/advisories/GHSA-4rj4-rcrq-gr92","type":"other"},{"url":"https://github.com/achiya-automation/safari-mcp/commit/23f1319defefd2c5cbd06b23189ab01876a8c5d3","type":"other"},{"url":"https://github.com/achiya-automation/safari-mcp/releases/tag/v2.22.15","type":"other"},{"url":"https://github.com/advisories/GHSA-4rj4-rcrq-gr92","type":"other"},{"url":"https://github.com/achiya-automation/safari-mcp","type":"package"}],"sources":[{"name":"osv","at":"2026-11-19T22:51:57.843Z","url":"https://osv.dev/vulnerability/GHSA-4rj4-rcrq-gr92","license":"CC-BY 4.0","firstSeenAt":"2026-11-19T22:51:57.843Z"},{"name":"ghsa","at":"2026-12-04T04:34:09.559Z","url":"https://github.com/advisories/GHSA-4rj4-rcrq-gr92","license":"CC-BY 4.0","firstSeenAt":"2026-11-19T22:19:31.698Z"}],"firstSeenAt":"2026-11-19T22:19:31.698Z","publishedAt":"2026-11-19T22:17:05.000Z","modifiedAt":"2026-11-19T22:45:06.189Z"}