Skip to content

Update dependency @tiptap/core to v3.30.4 [SECURITY] - autoclosed - #275

Closed
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-tiptap-core-vulnerability
Closed

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-tiptap-core-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@tiptap/core (source) 3.24.0 → 3.30.4 age confidence

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

GHSA-cp6q-959q-f8rh

More information

Details

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/core@2.0.0-alpha.0, 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.

Severity

  • CVSS Score: 6.4 / 10 (Medium)
  • 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

ueberdosis/tiptap (@​tiptap/core)

v3.30.4

Compare Source

@​tiptap/core
Patch Changes
  • Prevent untrusted HTML attributes from changing an object's prototype when merged with mergeAttributes.

v3.30.3

Compare Source

Patch Changes
  • 965a880: Fix JSX runtime to properly render nested sibling elements by spreading children arrays into DOMOutputSpec

v3.30.2

Compare Source

Patch Changes
  • 3dffed5: Keep mixed JSX children as separate siblings in DOM output.
  • 214a140: Fixed a bug where editor.chain and editor.can can not be accessed on editor initialization

v3.30.1

Compare Source

Patch Changes
  • abc8828: Added new ProseMirror helpers that check whether a value is a specific ProseMirror type.

v3.30.0

Compare Source

Minor Changes
  • 0247d39: ListKeymap now registers a Tab shortcut that sinks a top-level textblock into the previous list's last item. Pressing Tab at the start of a paragraph right after a bullet/ordered/task list moves the paragraph inside the last list item. The handler does nothing when the cursor is already inside a list item (sinkListItem keeps working), when there is no list before the paragraph, when the caret is mid-textblock, or when the selection is not a text selection (for example a gap cursor).

    @tiptap/core also exposes a new getPreviousBlockSibling($pos) helper that returns the block-level sibling before the cursor's textblock, or null at the first child of the block parent.

  • 3099eef: New Decorations API

    Finally the decorations API is here! Even though Decorations itself are nothing new in ProseMirror, the new API makes it much easier to use them in Tiptap without leaving your extensions.

    Decorations change how the document looks without changing the document itself. Highlighting search results, marking spelling mistakes, showing collaborator cursors, putting a drag handle next to every block.

    Until now you had to write a ProseMirror plugin by hand for this, keep the decoration set in plugin state, and map it forward on every transaction. Extensions can now declare decorations directly with a new addDecorations() hook.

    addDecorations() {
      return {
        create: ({ state }) =>
          // findMatches can be any function that returns an array of { from, to } ranges
          findMatches(state.doc).map(match =>
            Decoration.Inline(match.from, match.to, { class: 'highlight' }),
          ),
      }
    }

    There are three kinds. Decoration.Inline() styles a range of text. Decoration.Node() puts attributes on a block's DOM element. Decoration.Widget() renders your own element at a single position.

    Every extension that declares decorations is collected into one plugin, so several extensions can decorate the same document without fighting over it.

    Doing less work on every keystroke

    By default decorations are rebuilt whenever the document changes. That is fine for small documents and wasteful for large ones, so there are two ways to narrow it down.

    shouldUpdate() skips transactions you do not care about. If your decorations only depend on headings, ignore everything else.

    update: 'changedRanges' together with createInRange() only rescans the blocks that actually changed. On a long document this is the difference between scanning the whole thing on every keystroke and scanning one paragraph.

    For decorations driven by data outside the editor, like comments loaded from a server, use update: 'manual' and refresh them yourself with editor.commands.updateDecorations().

    React and Vue components as widgets

    ReactWidgetRenderer and VueWidgetRenderer render a real component into a widget decoration, inside your existing app context. Providers, context and stores work as usual.

    Widgets take a key. Reuse the same key and the component instance stays mounted while the document changes around it, so local state such as an open menu, a counter or a half-typed input survives editing. Use a stable id from your own data, not a position or a list index, otherwise the component remounts and loses that state.

    Widgets also accept the ProseMirror options side, relaxedSide, stopEvent and ignoreSelection.

    Documentation

Patch Changes
  • 51909d3: Fixed insertContent, insertContentAt and setContent failing when prosemirror-model is loaded more than once.
  • Updated dependencies [58a8953]

v3.29.2

Compare Source

Patch Changes

v3.29.1

Compare Source

Patch Changes

v3.29.0

Compare Source

Patch Changes
  • d26840f: Fix a TypeScript build error in isAndroid() where comparing navigator.platform against the literal 'Android' with === could fail to compile under some lib.dom.d.ts typings ("types have no overlap"). Switched to the same .includes() pattern already used by isiOS(), which is not affected by this TypeScript narrowing issue. No runtime behavior change.
  • 935e63f: Fixed a bug where deleting an AllSelection (for example right after Ctrl/Cmd+A) left a lingering "phantom" selection highlight over the emptied document instead of a text cursor. deleteSelection now collapses the selection to a cursor.
  • b4c5a2d: Fix input rules crashing when the matched text spans an inline atom node like a mention.
  • a963d48: Node view getPos() now returns undefined instead of throwing when the position cannot be resolved yet, for example when React 19 renders a node view component while the editor view is still updating.
  • 51f45b6: Fixed onContentError throwing when calling editor.commands from inside the handler on initial load with invalid content. The editor now has a usable state (seeded from the stripped fallback document) before onContentError fires.
  • 0f63969: Fix editor.$pos() returning the wrong node inside container nodes, for example the list item instead of the list.
  • 9acaa65: Add insertDefaultBlock to insert the default textblock allowed at a position. It accepts an optional position, attributes, content, and selection-update option.
  • Updated dependencies [e150ee0]

v3.28.0

Compare Source

Patch Changes

v3.27.4

Compare Source

Patch Changes

v3.27.3

Compare Source

Patch Changes
  • 023f98c: Fix deleteSelection to delete content across all selection ranges instead of only the first range. This restores multi-cell table selections and other custom selections with multiple ranges.

v3.27.2

Compare Source

Patch Changes

v3.27.1

Compare Source

Patch Changes

v3.27.0

Compare Source

Patch Changes
  • 0d0094d: Ordered lists now support the type attribute (a, A, i, I).

    The <ol> type attribute is now fully preserved through the HTML round-trip:

    • type="a" → lowercase alphabetical markers
    • type="A" → uppercase alphabetical markers
    • type="i" → lowercase roman numeral markers
    • type="I" → uppercase roman numeral markers

    Paste from external editors (Google Docs, Word, LibreOffice) now correctly detects the list style — both from the HTML type attribute and from CSS list-style-type properties.

    Plain text paste of typed ordered list markers (e.g. a. Item, I) Item, i. Item\nii. Item) is detected and converted to the correct list type.

    Markdown round-trip preserves typed markers: parsing a. Item creates type: "a", and serializing a typed list back to markdown uses the correct prefix (e.g. I., ii.).

    Joining of adjacent lists now respects type — two lists with different types (e.g. default numeric and type="a") are not merged.

  • 795033c: parseAttributes now supports any word characters at the start of classes or id attributes.

  • 0e0c4f9: Fix marksEqual to compare mark arrays as multisets instead of index-by-index, so order of marks no longer affects the result. Broaden the type signature to accept ProseMirror Mark objects (where type is an object with a name property) alongside the existing JSON mark shape ({ type: string }).

  • 6d12bb9: Fix a edge-case in rewriteUnknownContent to not fail on null-ish values inside marks or nodes.

v3.26.1

Compare Source

Patch Changes

v3.26.0

Compare Source

Patch Changes

v3.25.0

Compare Source

Patch Changes
  • ec291dd: Fix: dragging an inline/resizable image within the editor no longer creates a duplicate

    When the Image extension was configured with inline: true or resize enabled, dragging an image within the editor could insert a duplicate at the drop position instead of moving it. This happened because the browser's native image drag behavior could populate dataTransfer.files, causing the FileHandler extension to intercept the drop before ProseMirror's internal move logic could run.

  • 454e9b8: Add clearable mark option (default true). unsetAllMarks now skips marks with clearable: false, so semantic marks like comments are not removed by "clear formatting".

  • 9cf8db0: Add attrsEqual and marksEqual utility functions to @tiptap/core. attrsEqual compares two attribute objects for equality regardless of key ordering. marksEqual compares two arrays of mark objects by type and attributes using attrsEqual.

  • 3d4f94c: Fix plain-text copy of table cell selections including content from unselected cells in between. Each selected range is now serialized independently and joined in document order, so dragging upward (reverse selection) also produces output in document order.

  • Updated dependencies [c1a2ce8]


Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate

renovate Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: @convex-dev/prosemirror-sync@0.3.0
npm error Found: @tiptap/core@3.30.4
npm error node_modules/@tiptap/core
npm error   dev @tiptap/core@"3.30.4" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @tiptap/core@"3.24.0" from @tiptap/extension-highlight@3.24.0
npm error node_modules/@tiptap/extension-highlight
npm error   dev @tiptap/extension-highlight@"3.24.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /runner/cache/others/npm/_logs/2026-12-01T13_05_45_539Z-eresolve-report.txt
npm error A complete log of this run can be found in: /runner/cache/others/npm/_logs/2026-12-01T13_05_45_539Z-debug-0.log

@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch from caf4ed1 to 49c9fcf Compare September 10, 2026 03:20
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch 2 times, most recently from d104f54 to 782d493 Compare October 2, 2026 22:49
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch 3 times, most recently from b95a864 to dca8a2b Compare October 15, 2026 06:52
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch 3 times, most recently from 98c61e2 to 0a3f996 Compare November 11, 2026 18:10
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch from 0a3f996 to b28bdf7 Compare November 18, 2026 03:13
@renovate renovate Bot changed the title chore(deps): update dependency @tiptap/core to v3.30.4 [security] Update dependency @tiptap/core to v3.30.4 [SECURITY] Nov 18, 2026
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch 5 times, most recently from 2765596 to c45e230 Compare November 24, 2026 02:32
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch from c45e230 to 9957129 Compare November 27, 2026 05:02
@renovate
renovate Bot force-pushed the renovate/npm-tiptap-core-vulnerability branch from 9957129 to 456edb2 Compare December 1, 2026 13:05
@renovate renovate Bot changed the title Update dependency @tiptap/core to v3.30.4 [SECURITY] Update dependency @tiptap/core to v3.30.4 [SECURITY] - autoclosed Dec 1, 2026
@renovate renovate Bot closed this Dec 1, 2026
@renovate
renovate Bot deleted the renovate/npm-tiptap-core-vulnerability branch December 1, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants