nday
GHSA-4rj4-rcrq-gr92

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

披露当天有补丁记录。已有补丁记录,修复版本是 safari-mcp 2.22.15。四个 PoC 来源都还没有收录。尚未列入 CISA KEV。

标签 漏洞类型code injection 攻击途径本地无需用户交互 软件包生态npm
这些标签的依据

这些标签由 nday 按固定规则从下列事实自动推导,不是 NVD、编号分配方或其他来源给出的。全部标签和规则见 ~/tags。

code injection
CWE-94(来源:GitHub 公告 GHSA-4rj4-rcrq-gr92)
本地
GitHub 公告 GHSA-4rj4-rcrq-gr92 给出的 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)中的 AV:L
无需用户交互
GitHub 公告 GHSA-4rj4-rcrq-gr92 给出的 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)中的 UI:N
npm
GHSA-4rj4-rcrq-gr92:npm 包 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.

以上是 GitHub 安全公告 GHSA-4rj4-rcrq-gr92 中的原文,未经改写。

利用条件

按 CVSS 向量说明攻击需要的条件。
攻击途径 AV:L
本地:需要本地或 SSH 会话,或诱使用户在本机上操作
攻击复杂度 AC:L
低:不需要绕过目标特有的安全防护
攻击前提 AT:N
无:能否成功与目标的部署和运行条件无关
所需权限 PR:L
低:普通用户权限
用户交互 UI:N
无:除攻击者外不需要任何人配合

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 向量,来自 GitHub 安全公告 GHSA-4rj4-rcrq-gr92。

事件记录

+DIS披露

ghsa 报告了披露事件。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "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
  }
}
来源未给时间,本站实时观测
+PAT补丁发布

公告给出修复版本 safari-mcp 2.22.15。公告附有修复提交。公告本身发布于 ,补丁实际发布时间没有记录。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "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"
  }
}

纠错

报告错误或缺失

页面有误或缺失?告诉编辑;采纳后在本页修订记录公开说明,上游数据不会被改动。

讨论

0 条评论

还没有评论。