nday
GHSA-4rj4-rcrq-gr92

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

CVE 공개 당일 패치 기록. 해결 버전: safari-mcp 2.22.15. PoC 출처 4곳 모두 미등재. 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.

이벤트 로그

+DISCVE 공개

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.