Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Milkdown before 7.21.3 contains a DOM cross-site scripting vulnerability in the @milkdown/plugin-emoji package that allows unauthenticated attackers… (CVE-2026-57531)

0
Medium
Published: 07/24/2026 (07/24/2026, 21:32:22 UTC)
Source: GCVE Database

Description

Milkdown versions before 7.21.3 contain a DOM-based cross-site scripting (XSS) vulnerability in the @milkdown/plugin-emoji package. This vulnerability allows unauthenticated attackers to execute arbitrary JavaScript in the context of the host application by tricking a victim into pasting attacker-controlled content. The issue arises because the plugin's parseDOM.getAttrs handler stores raw innerHTML from pasted span elements with data-type="emoji" without sanitization. Later, the toMarkdown runner assigns this unsanitized content directly to a live DOM element's innerHTML, bypassing the DOMPurify sanitization used elsewhere, resulting in script execution during markdown serialization cycles.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
None
Scope
X
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Affected software

Affected versions
<7.21.3

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/25/2026, 23:54:47 UTC

Technical Analysis

The vulnerability in Milkdown before version 7.21.3 is a DOM-based cross-site scripting flaw in the @milkdown/plugin-emoji package. It stems from improper sanitization of pasted emoji content: the parseDOM.getAttrs handler captures raw innerHTML from pasted span elements marked as emojis without cleaning it. Subsequently, the toMarkdown runner injects this unsanitized HTML directly into the DOM, bypassing the sanitization path used in toDOM. This flaw allows unauthenticated attackers to execute arbitrary JavaScript in the victim's browser when the victim pastes malicious content, leading to potential script execution on every markdown serialization cycle.

Potential Impact

An attacker can execute arbitrary JavaScript code in the context of the host application by causing a victim to paste specially crafted content. This can lead to theft of sensitive information, session hijacking, or other malicious actions within the victim's browser session. The vulnerability affects the integrity and security of the markdown rendering process in affected Milkdown versions.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The vulnerability is fixed in Milkdown version 7.21.3 and later. Users should upgrade to version 7.21.3 or newer to remediate this issue. Until patched, avoid pasting untrusted content that could exploit this vulnerability.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-7jff-jg2j-4x95
Osv Schema Version
1.4.0
Aliases
["CVE-2026-57531"]
Ecosystems
[]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6a65422a9c2644c7f808a199

Added to database: 07/25/2026, 23:09:30 UTC

Last enriched: 07/25/2026, 23:54:47 UTC

Last updated: 07/26/2026, 04:00:58 UTC

Views: 6

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses