CVE-2026-57530

Milkdown < 7.21.3 Stored XSS via javascript: URL in link href

Published Jul 24, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
Milkdown before 7.21.3 contains a stored cross-site scripting vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages that allows attackers with document write access to execute arbitrary JavaScript in the browser context of any user who opens the document or clicks a rendered link. The parseMarkdown runner stores raw URL values from the remark AST as href mark attributes without URL scheme validation, and the ineffective DOMPurify.sanitize call in edit-view.ts treats the bare URL string as a text node and returns it unchanged, allowing javascript: payloads to pass through the link-tooltip preview component and read-only mode anchor elements unmodified.

Analysis

AI-generated

Technical impact

Milkdown before version 7.21.3 contains a stored cross‑site scripting flaw in the @milkdown/preset-commonmark and @milkdown/components packages. An attacker who can write to a document can embed a link whose href contains a javascript: URL. During parsing, the URL is stored as a raw href attribute without scheme validation, and the DOMPurify.sanitize call fails to treat it as an anchor element, so the javascript: payload is preserved. When another user opens the document or clicks the rendered link, the JavaScript runs in that user’s browser context, allowing arbitrary client‑side code to execute.

Affected Systems

All releases of Milkdown prior to 7.21.3 that include the vulnerable @milkdown/preset-commonmark and @milkdown/components packages. Any deployment that has not upgraded to v7.21.3 or later is susceptible regardless of the hosting environment, provided an attacker has permission to write to the document.

Risk and Exploitability

The CVSS score of 5.1 indicates a moderate severity. The EPSS score of less than 1% and the absence from the CISA KEV catalog imply a low likelihood of widespread exploitation at this time. The vulnerability requires an attacker to have document‑write access to inject the malicious link and then rely on another user to open the document or click the link; once that occurs the stored payload executes in the victim’s browser. Because no network‑level or elevated privileges are required beyond document write rights, the overall risk remains moderate.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Milkdown to version 7.21.3 or later.
  • If an upgrade cannot be performed immediately, remove or sanitize any javascript: URLs from links before rendering or delete them from stored content.
  • Restrict document write permissions to trusted users or implement content moderation to prevent injection of malicious links.

Generated by OpenCVE AI on August 4, 2026 at 14:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Milkdown
Milkdown milkdown
Vendors & Products Milkdown
Milkdown milkdown
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Milkdown before 7.21.3 contains a stored cross-site scripting vulnerability in the @milkdown/preset-commonmark and @milkdown/components packages that allows attackers with document write access to execute arbitrary JavaScript in the browser context of any user who opens the document or clicks a rendered link. The parseMarkdown runner stores raw URL values from the remark AST as href mark attributes without URL scheme validation, and the ineffective DOMPurify.sanitize call in edit-view.ts treats the bare URL string as a text node and returns it unchanged, allowing javascript: payloads to pass through the link-tooltip preview component and read-only mode anchor elements unmodified.
Title Milkdown < 7.21.3 Stored XSS via javascript: URL in link href
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 5.1, 'vector': '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'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 25, 2026, 10:30 AM
Reserved
Jun 24, 2026, 3:58 PM
Status
Deferred
Published
Jul 24, 2026, 8:18 PM
Modified
Jul 27, 2026, 8:37 PM