Milkdown before 7.21.3 contains a stored cross-site scripting vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages… (CVE-2026-57530)
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.
AI Analysis
Technical 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.
Potential 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.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. 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.
Milkdown before 7.21.3 contains a stored cross-site scripting vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages… (CVE-2026-57530)
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.
CVSS v4.0
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
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.
Potential 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.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. 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.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-f8jw-52vm-m867
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-57530"]
- Ecosystems
- []
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a6542289c2644c7f808a01a
Added to database: 07/25/2026, 23:09:28 UTC
Last enriched: 07/25/2026, 23:54:26 UTC
Last updated: 07/26/2026, 06:14:50 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.