Skip to main content
Vulnerability Database/CVE-2026-104847

CVE-2026-104847: ProseMirror View XSS Vulnerability

CVE-2026-104847 is a cross-site scripting flaw in ProseMirror view component that allows attackers to execute malicious JavaScript through crafted clipboard content. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104847 Overview

CVE-2026-104847 is a cross-site scripting (XSS) vulnerability in prosemirror-view, the component that renders and manages the editable browser interface for ProseMirror documents. Versions prior to 1.42.3 accept attacker-provided HTML in which the clipboard slice context carries attributes that bypass schema attribute validation. When a user pastes crafted HTML into an editor, the unvalidated context attributes construct content that executes attacker-controlled JavaScript in the browser window hosting the editor. The flaw is tracked as [CWE-79] and is fixed in version 1.42.3.

Critical Impact

Pasting attacker-controlled HTML into any application using a vulnerable prosemirror-view instance leads to arbitrary JavaScript execution in the victim's browser context, enabling session theft, account takeover, and data exfiltration.

Affected Products

  • prosemirror-view versions prior to 1.42.3
  • Web applications and editors that embed ProseMirror for rich-text editing
  • Downstream frameworks and CMS platforms that bundle prosemirror-view as a dependency

Discovery Timeline

  • 2026-10-02 - CVE-2026-104847 published to the National Vulnerability Database (NVD)
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-104847

Vulnerability Analysis

The vulnerability lives in the clipboard handling path of prosemirror-view. ProseMirror serializes a document slice into HTML on copy and reconstructs it on paste. The slice includes a context describing the ancestor nodes that surround the copied fragment. On paste, the view walks that context and rebuilds the ancestor nodes using the schema's node types and attributes.

Prior to version 1.42.3, the paste handler called type.create() with attribute objects taken from the clipboard context without running them through the schema's attribute validators. An attacker could craft HTML whose context section specified attribute values that would normally be rejected by the schema. The resulting node then produced DOM output that executed JavaScript when the editor rendered it. The outcome is a stored or reflected XSS, depending on how the host application persists editor content.

Root Cause

The root cause is missing input validation on clipboard slice context attributes. The schema already exposes checkAttrs() to enforce per-attribute constraints, but the context reconstruction loop skipped this check. As a result, the trust boundary between untrusted clipboard HTML and the schema's attribute model was not enforced.

Attack Vector

Exploitation requires user interaction: the victim must paste attacker-supplied HTML into a ProseMirror-backed editor. The payload can be delivered through a crafted web page, email, chat message, or any surface that places HTML on the clipboard. Once pasted, the malicious attributes drive the construction of a node whose rendered DOM runs attacker JavaScript in the origin of the hosting application.

typescript
// Patch excerpt from src/clipboard.ts (ProseMirror)
for (let i = array.length - 2; i >= 0; i -= 2) {
  let type = schema.nodes[array[i]]
  if (!type || type.hasRequiredAttrs()) break
  try { type.checkAttrs(array[i + 1]) }
  catch(e) { break }
  content = Fragment.from(type.create(array[i + 1], content))
  openStart++; openEnd++
}
// Source: https://github.com/ProseMirror/prosemirror-view/commit/2e91a612bbc1248e55b4f6061fc93fe459f977c1

The added type.checkAttrs() call validates the attribute object against the schema before type.create() builds a node from it. If validation fails, the loop breaks and the untrusted context is discarded.

Detection Methods for CVE-2026-104847

Indicators of Compromise

  • Editor documents containing unexpected inline event-handler attributes (for example onclick, onerror) or javascript: URIs on nodes that the schema should not allow
  • Browser console errors or Content Security Policy (CSP) violation reports originating from pages that embed a ProseMirror editor
  • Outbound requests from an editor page to attacker-controlled domains shortly after a paste event

Detection Strategies

  • Inventory JavaScript dependencies and flag any application using prosemirror-view below 1.42.3 via software composition analysis (SCA) tooling
  • Add server-side sanitization checks on editor-submitted content and alert when disallowed attributes or script-bearing URIs reach storage
  • Review browser telemetry and web application firewall (WAF) logs for POST bodies containing script payloads submitted from editor endpoints

Monitoring Recommendations

  • Enable and monitor CSP report-uri or report-to endpoints for inline script violations on pages hosting ProseMirror
  • Correlate authentication anomalies, such as session reuse from new IPs, with recent editor paste activity
  • Track dependency updates in CI pipelines so that out-of-date prosemirror-view versions trigger build warnings

How to Mitigate CVE-2026-104847

Immediate Actions Required

  • Upgrade prosemirror-view to version 1.42.3 or later across all applications and transitive dependencies
  • Audit lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) to confirm no vulnerable version resolves at build time
  • Apply or tighten a Content Security Policy that blocks inline scripts and restricts script sources on pages that host the editor

Patch Information

The fix is published in prosemirror-view 1.42.3. The relevant commits are available in the project repository: ProseMirror clipboard validation commit and a related clipboard update. See the ProseMirror Security Advisory GHSA-c8x8-7fp4-3x9w for the full disclosure.

Workarounds

  • Where immediate upgrade is not feasible, sanitize clipboard HTML on paste using a vetted library such as DOMPurify before handing it to the editor
  • Restrict the editor schema to a minimal set of node types and attributes, removing node types that permit arbitrary attribute values
  • Enforce a strict CSP (script-src 'self') and disable inline event handlers to contain the impact of successful injection
bash
# Upgrade prosemirror-view to the patched release
npm install prosemirror-view@^1.42.3

# Verify the installed version
npm ls prosemirror-view

# Audit the project for remaining advisories
npm audit --production

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.