nday
GHSA-4rj4-rcrq-gr92

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

公開当日に修正版が確認されています。修正済みバージョンは safari-mcp 2.22.15 です。4 つの PoC ソースのいずれにも未掲載です。CISA KEV には現時点で未掲載です。

tags weakness typecode injection accesslocalno user interaction ecosystemnpm
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

code injection
CWE-94, stated by GitHub advisory GHSA-4rj4-rcrq-gr92
local
AV:L in 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 (CVSS 4.0) from GitHub advisory GHSA-4rj4-rcrq-gr92
no user interaction
UI:N in 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 (CVSS 4.0) from GitHub advisory GHSA-4rj4-rcrq-gr92
npm
GHSA-4rj4-rcrq-gr92: npm packages safari-mcp
現在の段階
PAT
公開日時
公開から修正版まで
T+0d
CVSS 基本値
6.2 MEDIUM v4.0

ライフサイクル

横軸は UTC。点=分単位、幅広の帯=日付のみ、白抜き=不明または推定。
日時不明
DIS公開
11-19T22:17Z
PAT修正
11-19T23:01Z
ANA解析
記録なし
POCPoC
記録なし
ITW悪用
記録なし
KEVKEV
記録なし

概要

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

Original text of GitHub advisory GHSA-4rj4-rcrq-gr92, shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:L
Low: no target-specific security measures to get around
Attack requirements AT:N
None: success does not depend on how the target is deployed or running
Privileges required PR:L
Low: ordinary user privileges
User interaction UI:N
None: no action by anyone other than the attacker

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

CVSS 4.0 vector from GitHub advisory GHSA-4rj4-rcrq-gr92.

イベント履歴

+DIS公開

ghsa が公開を報告。

出典 ghsa · nday が にリアルタイムで観測 · 生データ
{
  "id": 489245,
  "type": "disclosed",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-4rj4-rcrq-gr92",
  "occurred_at": "2026-11-19T22:17:05Z",
  "observed_at": "2026-11-19T23:01:42.561574Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-4rj4-rcrq-gr92",
  "detail": {
    "state": "PUBLISHED",
    "ghsa_id": "GHSA-4rj4-rcrq-gr92",
    "withdrawn_at": null
  }
}
ソースに時刻なし、nday が観測
+PAT修正版公開

アドバイザリ記載の修正済みバージョン:safari-mcp 2.22.15。修正コミットへのリンクあり。アドバイザリの公開は 。修正版そのもののリリース日時は記録なし。

出典 ghsa · nday が にリアルタイムで観測 · 生データ
{
  "id": 489246,
  "type": "patch_released",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-4rj4-rcrq-gr92",
  "occurred_at": null,
  "observed_at": "2026-11-19T23:01:42.561574Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-4rj4-rcrq-gr92",
  "detail": {
    "cvss": {
      "cvss_v3": {
        "score": 0.0,
        "vector_string": null
      },
      "cvss_v4": {
        "score": 6.2,
        "vector_string": "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"
      }
    },
    "cwes": [
      {
        "name": "Improper Control of Generation of Code",
        "cwe_id": "CWE-94"
      },
      {
        "name": "Improper Encoding or Escaping of Output",
        "cwe_id": "CWE-116"
      }
    ],
    "ghsa_id": "GHSA-4rj4-rcrq-gr92",
    "packages": [
      {
        "name": "safari-mcp",
        "ecosystem": "npm",
        "first_patched_version": "2.22.15",
        "vulnerable_version_range": "< 2.22.15"
      }
    ],
    "severity": "medium",
    "references": [
      "https://github.com/achiya-automation/safari-mcp/security/advisories/GHSA-4rj4-rcrq-gr92",
      "https://github.com/achiya-automation/safari-mcp/commit/23f1319defefd2c5cbd06b23189ab01876a8c5d3",
      "https://github.com/achiya-automation/safari-mcp/releases/tag/v2.22.15",
      "https://github.com/advisories/GHSA-4rj4-rcrq-gr92"
    ],
    "fix_commit_urls": [
      "https://github.com/achiya-automation/safari-mcp/commit/23f1319defefd2c5cbd06b23189ab01876a8c5d3"
    ],
    "github_reviewed_at": "2026-11-19T22:17:05Z",
    "advisory_updated_at": "2026-11-19T22:17:08Z",
    "source_code_location": "https://github.com/achiya-automation/safari-mcp",
    "advisory_published_at": "2026-11-19T22:17:05Z"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Discussion

0 comments

No comments yet.