Description
Milkdown before 7.21.3 contains a DOM cross-site scripting vulnerability in the @milkdown/plugin-emoji package that allows unauthenticated attackers to execute arbitrary JavaScript in the host application's origin by causing a victim to paste attacker-controlled content. The parseDOM.getAttrs handler stores raw innerHTML of pasted span elements with data-type="emoji" without sanitization, and the toMarkdown runner subsequently assigns this unsanitized value directly to a live DOM element's innerHTML, bypassing the DOMPurify sanitization used in the toDOM path, causing payload execution on every markdown serialization cycle.
Published: 2026-07-24
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Milkdown versions earlier than 7.21.3 are vulnerable to a DOM cross‑site scripting flaw in the @milkdown/plugin-emoji module. The module's parseDOM.getAttrs handler stores the raw innerHTML of pasted span elements carrying data‑type="emoji" without sanitization. When the toMarkdown runner later serializes markdown, it assigns this unsanitized innerHTML directly to a live DOM element, bypassing the DOMPurify sanitization normally applied on the toDOM path. The result is that an unauthenticated attacker can cause a victim to paste attacker‑controlled emoji‑containing content, leading to arbitrary JavaScript execution in the host application's origin.

Affected Systems

All web applications that integrate the Milkdown editor library together with the @milkdown/plugin-emoji plugin, specifically Milkdown versions before 7.21.3. Any project embedding Milkdown without updating to the patched release is at risk.

Risk and Exploitability

The CVSS score of 5.1 indicates a moderate severity, while the EPSS score of less than 1% reflects a low probability of exploitation. The vulnerability is not listed in the CISA KEV catalog. Because the flaw is client‑side and requires a victim to paste content, attackers would most likely use social engineering or malicious clipboard content to trigger the vulnerability. Clients that have not upgraded remain susceptible to payload execution whenever a user pastes emoji content.

Generated by OpenCVE AI on August 3, 2026 at 19:44 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Milkdown and the @milkdown/plugin-emoji package to version 7.21.3 or newer.
  • If a quick upgrade is not possible, remove or disable the @milkdown/plugin-emoji plugin from the editor configuration.
  • Implement client‑side sanitization on any innerHTML assignment – for example, use DOMPurify to cleanse emoji content before it is rendered, or filter pasted content to remove data‑type="emoji" spans.

Generated by OpenCVE AI on August 3, 2026 at 19:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 27 Jul 2026 13:15:00 +0000

Type Values Removed Values Added
First Time appeared Milkdown
Milkdown milkdown
Vendors & Products Milkdown
Milkdown milkdown

Sat, 25 Jul 2026 01:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 24 Jul 2026 19:45:00 +0000

Type Values Removed Values Added
Description Milkdown before 7.21.3 contains a DOM cross-site scripting vulnerability in the @milkdown/plugin-emoji package that allows unauthenticated attackers to execute arbitrary JavaScript in the host application's origin by causing a victim to paste attacker-controlled content. The parseDOM.getAttrs handler stores raw innerHTML of pasted span elements with data-type="emoji" without sanitization, and the toMarkdown runner subsequently assigns this unsanitized value directly to a live DOM element's innerHTML, bypassing the DOMPurify sanitization used in the toDOM path, causing payload execution on every markdown serialization cycle.
Title Milkdown < 7.21.3 DOM XSS via innerHTML Assignment
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

Milkdown Milkdown
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-25T10:30:03.580Z

Reserved: 2026-06-24T15:58:58.538Z

Link: CVE-2026-57531

cve-icon Vulnrichment

Updated: 2026-07-25T00:59:23.686Z

cve-icon NVD

Status : Deferred

Published: 2026-07-24T20:18:03.530

Modified: 2026-07-27T20:37:34.230

Link: CVE-2026-57531

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T19:45:07Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')