Skip to main content
CVE-2026-57530VulnerabilityPublished 07/24/2026

Milkdown before 7.21.3 contains a stored cross-site scripting vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages… (CVE-2026-57530)

Source GCVE Database

0
Severity
Medium

No CVSS score published yet

Exploitation

Not in CISA KEV, no exploitation reported

EPSS
0.3% chance of exploitation in 30 days – higher than 23% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
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

What to do

AI-suggested

Users should upgrade to Milkdown version 7.21.3 or later once available. Until then, restrict document write access to trusted users only to reduce the risk of exploitation.

Description

Milkdown versions before 7.21.3 contain a stored cross-site scripting (XSS) vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages. This vulnerability allows attackers with document write access to inject arbitrary JavaScript that executes in the browser context of users who open the affected document or interact with rendered links. The issue arises because raw URL values from the remark AST are stored as href attributes without validating the URL scheme, and the DOMPurify.sanitize call fails to properly sanitize these URLs, allowing javascript: payloads to bypass filtering in link previews and anchor elements.

Impact

An attacker with the ability to write to a document can inject malicious JavaScript code that executes in the browsers of users who open the document or click on rendered links. This can lead to cross-site scripting attacks, potentially compromising user sessions, stealing sensitive information, or performing actions on behalf of the user within the affected application context.

Summary

The vulnerability in Milkdown before version 7.21.3 is a stored cross-site scripting issue affecting the @milkdown/preset-commonmark and @milkdown/components packages. It occurs because the parseMarkdown runner stores raw URL values from the remark AST as href mark attributes without validating the URL scheme. Additionally, the DOMPurify.sanitize function used in edit-view.ts does not effectively sanitize these URLs, treating them as text nodes and allowing malicious javascript: URLs to pass through unmodified. This enables attackers with write access to documents to execute arbitrary JavaScript in the browser context of users who view or interact with the document, leading to potential XSS attacks.

Weaknesses

References

Community reviews

Loading reviews…