nday
GHSA-cp6q-959q-f8rh

Tiptap: mergeAttributes() turns an own __proto__ key into inherited executable DOM attributes

披露后第 90 天有补丁记录。已有补丁记录,修复版本是 @tiptap/core 3.30.4、@tiptap/core 2.27.3。四个 PoC 来源都还没有收录。尚未列入 CISA KEV。

标签 漏洞类型XSSprototype pollution 攻击途径网络无需认证 软件包生态npm
这些标签的依据

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

XSS
CWE-79(来源:GitHub 公告 GHSA-cp6q-959q-f8rh)
prototype pollution
CWE-1321(来源:GitHub 公告 GHSA-cp6q-959q-f8rh)
网络
GitHub 公告 GHSA-cp6q-959q-f8rh 给出的 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N(CVSS 4.0)中的 AV:N
无需认证
GitHub 公告 GHSA-cp6q-959q-f8rh 给出的 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N(CVSS 4.0)中的 PR:N
npm
GHSA-cp6q-959q-f8rh:npm 包 @tiptap/core
当前阶段
PAT
披露
披露到补丁
T+90d
CVSS
6.4 MEDIUM v4.0

生命周期

横轴 UTC;点=精确到分钟,宽条=仅日期,空心=未知或推定。
时间未知
DIS披露
09-02T14:44Z
PAT补丁
12-01T15:01Z
ANA分析
尚无记录
POCPoC
尚无记录
ITW在野
尚无记录
KEVKEV
尚无记录

摘要

## Summary

@tiptap/core's public mergeAttributes() helper uses ordinary bracket assignment on keys returned by Object.entries(). An own __proto__ key from JSON therefore invokes the legacy prototype setter on the fresh merged object. The function returns an object whose prototype is attacker-controlled, while Object.keys() and ordinary own-property checks show no attacker attributes.

When that result is used as a ProseMirror DOMOutputSpec attribute object, prosemirror-model's DOMSerializer.renderSpec() enumerates it with for...in and applies inherited values with setAttribute(). In a browser proof, inherited src and onerror values were copied to an <img> and the error handler executed once. This is per-object prototype manipulation; the proof does not modify global Object.prototype.

## Root cause

The affected loop is conceptually:

const mergedAttributes = { ...items }
for (const [key, value] of Object.entries(item)) {
  const exists = mergedAttributes[key]
  // ...
  mergedAttributes[key] = value
}

Object.entries(JSON.parse('{"__proto__": {...}}')) includes __proto__. Reading mergedAttributes['__proto__'] resolves the inherited Object.prototype; assigning to the same key invokes Object.prototype.__proto__'s setter and replaces mergedAttributes' prototype.

## Browser reproduction

The following shape was tested with exact @tiptap/core 3.29.2 and prosemirror-model 1.25.11:

const input = JSON.parse(`{
  "__proto__": {
    "data-inherited-canary": "present",
    "src": "x-invalid://canary",
    "onerror": "globalThis.__tiptapXss += 1"
  }
}`)

const attrs = mergeAttributes(input)
// Object.keys(attrs) === []
// Object.getPrototypeOf(attrs) === input.__proto__

const schema = new Schema({
  nodes: {
    doc: { content: 'image' },
    image: { toDOM: () => ['img', attrs] },
    text: {},
  },
})
const doc = schema.node('doc', null, [schema.node('image')])
const fragment = DOMSerializer.fromSchema(schema).serializeFragment(doc.content)
document.body.append(fragment)

Chromium produced an image with data-inherited-canary, src, and onerror; the handler executed exactly once. Object.prototype remained clean.

## Impact and preconditions

Applications that merge untrusted imported document, plugin, CMS, API, tenant, or AI-derived attribute objects can receive a prototype-manipulated result. Consumers that enumerate inherited keys, including ProseMirror's DOM serializer, can turn the hidden properties into DOM attributes and execute JavaScript in the application's origin. Own-key validation, object spread, JSON serialization, and logging can miss the inherited values. Other component consumers can read inherited authorization or configuration fields.

Tiptap's standard fixed ProseMirror schemas discard unknown document attributes, so arbitrary Tiptap JSON is not automatically exploitable in every application. A vulnerable application needs an untrusted object boundary into mergeAttributes() or a dynamic/custom extension or schema that preserves the relevant attribute object.

## Affected versions

The unsafe assignment was introduced in commit ecadf7ea0a7f8f39a8496a60edf0ac8f379e6eb3 and is present in the first package tag @tiptap/[email protected], v2.0.0, v2.27.1, v3.0.0, and current v3.29.2 source. No fixed release was found.

## Recommended remediation

Reject __proto__ before reading or assigning the key, or define copied keys as own data properties without invoking legacy setters. A minimal hardening is to skip key === '__proto__'. Add regression tests using an own JSON-origin __proto__ key and assert that the result keeps Object.prototype as its prototype, exposes no inherited attacker keys, and cannot create an event-handler attribute through DOMSerializer.

This was found during authorized dependency review and is being reported privately. No public zero-day issue has been opened.

以上是 GitHub 安全公告 GHSA-cp6q-959q-f8rh 中的原文,未经改写。

利用条件

按 CVSS 向量说明攻击需要的条件。
攻击途径 AV:N
网络:攻击者只要能通过网络访问到目标即可
攻击复杂度 AC:L
低:不需要绕过目标特有的安全防护
攻击前提 AT:N
无:能否成功与目标的部署和运行条件无关
所需权限 PR:N
无:不需要账号或授权
用户交互 UI:P
被动:只需有限的、非主动的交互,例如浏览某个页面

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N

CVSS 4.0 向量,来自 GitHub 安全公告 GHSA-cp6q-959q-f8rh。

事件记录

+DIS披露

ghsa 报告了披露事件。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "id": 564109,
  "type": "disclosed",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-cp6q-959q-f8rh",
  "occurred_at": "2026-09-02T14:44:39Z",
  "observed_at": "2026-12-01T15:01:52.464415Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-cp6q-959q-f8rh",
  "detail": {
    "state": "PUBLISHED",
    "ghsa_id": "GHSA-cp6q-959q-f8rh",
    "withdrawn_at": null
  }
}
来源未给时间,本站实时观测
+PAT补丁发布

公告给出修复版本 @tiptap/core 3.30.4、@tiptap/core 2.27.3。公告附有修复提交。公告本身发布于 ,补丁实际发布时间没有记录。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "id": 564110,
  "type": "patch_released",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-cp6q-959q-f8rh",
  "occurred_at": null,
  "observed_at": "2026-12-01T15:01:52.464415Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-cp6q-959q-f8rh",
  "detail": {
    "cvss": {
      "cvss_v3": {
        "score": 0.0,
        "vector_string": null
      },
      "cvss_v4": {
        "score": 6.4,
        "vector_string": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
      }
    },
    "cwes": [
      {
        "name": "Improper Neutralization of Input During Web Page Generation",
        "cwe_id": "CWE-79"
      },
      {
        "name": "Improperly Controlled Modification of Object Prototype Attributes",
        "cwe_id": "CWE-1321"
      }
    ],
    "ghsa_id": "GHSA-cp6q-959q-f8rh",
    "packages": [
      {
        "name": "@tiptap/core",
        "ecosystem": "npm",
        "first_patched_version": "3.30.4",
        "vulnerable_version_range": ">= 3.0.0-next.0, < 3.30.4"
      },
      {
        "name": "@tiptap/core",
        "ecosystem": "npm",
        "first_patched_version": "2.27.3",
        "vulnerable_version_range": ">= 2.0.0-alpha.0, < 2.27.3"
      }
    ],
    "severity": "medium",
    "references": [
      "https://github.com/ueberdosis/tiptap/security/advisories/GHSA-cp6q-959q-f8rh",
      "https://github.com/ueberdosis/tiptap/commit/01d7af8c983ee5954c63734f4fa46cb23ae3246d",
      "https://github.com/ueberdosis/tiptap/releases/tag/v3.30.4",
      "https://github.com/ueberdosis/tiptap/pull/8309",
      "https://github.com/ueberdosis/tiptap/commit/fa6abcce65e58c60d40c7cdf59950d4f03ce83a4",
      "https://github.com/advisories/GHSA-cp6q-959q-f8rh"
    ],
    "fix_commit_urls": [
      "https://github.com/ueberdosis/tiptap/commit/01d7af8c983ee5954c63734f4fa46cb23ae3246d",
      "https://github.com/ueberdosis/tiptap/pull/8309",
      "https://github.com/ueberdosis/tiptap/commit/fa6abcce65e58c60d40c7cdf59950d4f03ce83a4"
    ],
    "github_reviewed_at": "2026-09-02T14:44:39Z",
    "advisory_updated_at": "2026-12-01T14:20:43Z",
    "source_code_location": "https://github.com/ueberdosis/tiptap",
    "advisory_published_at": "2026-09-02T14:44:39Z"
  }
}

纠错

报告错误或缺失

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

讨论

0 条评论

还没有评论。