CVE-2026-57531
Received Received - Intake

DOM XSS in Milkdown Emoji Plugin via Unsanitized Paste Content

Vulnerability report for CVE-2026-57531, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-24

Last updated on: 2026-07-24

Assigner: VulnCheck

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-24
Last Modified
2026-07-24
Generated
2026-07-25
AI Q&A
2026-07-24
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
milkdown milkdown to 7.21.3 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

Milkdown before version 7.21.3 has a DOM-based cross-site scripting (XSS) vulnerability in the @milkdown/plugin-emoji package. Attackers can exploit this by tricking a user into pasting malicious content. The vulnerability occurs because the raw innerHTML of pasted span elements with data-type='emoji' is stored without sanitization. When markdown is serialized, this unsanitized value is assigned directly to a live DOM element's innerHTML, bypassing DOMPurify sanitization and executing the payload.

Detection Guidance

To detect this vulnerability, inspect your Milkdown installations for versions before 7.21.3. Check for the presence of the @milkdown/plugin-emoji package and verify if the parseDOM.getAttrs handler stores raw innerHTML without sanitization. Review markdown serialization processes for unsanitized DOM assignments.

Impact Analysis

This vulnerability allows unauthenticated attackers to execute arbitrary JavaScript in the host application's origin. If you use Milkdown versions before 7.21.3 and paste content from untrusted sources, attackers could steal sensitive data, perform actions on your behalf, or compromise your session.

Compliance Impact

This vulnerability could potentially violate compliance with GDPR and HIPAA by enabling unauthorized execution of JavaScript in the host application's origin. This may lead to data breaches, unauthorized access to sensitive information, or manipulation of user data, which are critical concerns under these regulations.

Mitigation Strategies

Immediately update Milkdown to version 7.21.3 or later. Remove or disable the @milkdown/plugin-emoji package if not required. Implement additional input sanitization for pasted content, ensuring all DOM assignments are properly sanitized before rendering.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-57531. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart