CVE-2026-57531 Details
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.
A DOM-based cross-site scripting vulnerability has been identified in Milkdown versions prior to 7.21.3, specifically within the @milkdown/plugin-emoji package. This vulnerability allows unauthenticated attackers to execute arbitrary JavaScript in the context of the host application's origin. The issue arises when a victim pastes content controlled by the attacker, which is then processed by the emoji plugin without proper sanitization. The vulnerability exploits the fact that the parseDOM.getAttrs handler captures raw innerHTML from pasted span elements designated as emojis, and the toMarkdown runner subsequently injects this unsanitized content directly into a live DOM element's innerHTML. This bypasses the DOMPurify sanitization applied during the toDOM conversion, leading to the execution of malicious payloads with each markdown serialization.
Users can update to Milkdown version 7.21.3 or later, where this vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 24, 2026CISA-ADP
Assessed Jul 25, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/Milkdown/milkdown/commit/db1ae721854a0ab2f188b83cf8695702966640f1 | [email protected] | Source CodeVendor |
| https://github.com/Milkdown/milkdown/pull/2410 | [email protected] | Issue TrackingVendor |
| https://github.com/Milkdown/milkdown/releases/tag/v7.21.3 | [email protected] | Release NotesVendor |
| https://www.npmjs.com/package/@milkdown/plugin-emoji | [email protected] | Permission RequiredProductVendor |
| https://www.vulncheck.com/advisories/milkdown-dom-xss-via-innerhtml-assignment | [email protected] | AdvisoryRemedy |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Milkdown | < 7.21.3 (semver) |
CPE
Remediation
| |
| Milkdown plugin-emoji | All versions |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 25, 2026 | CVE Modified | CISA-ADP |
| Jul 24, 2026 | New CVE Received | [email protected] |
Volerion