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.
Published: 2026-07-24
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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 yet.

History

Mon, 27 Jul 2026 13:15:00 +0000

Type Values Removed Values Added
First Time appeared Milkdown
Milkdown milkdown
Vendors & Products Milkdown
Milkdown milkdown

Fri, 24 Jul 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 24 Jul 2026 19:45:00 +0000

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'}


Subscriptions

Milkdown Milkdown
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-25T10:30:02.895Z

Reserved: 2026-06-24T15:58:58.538Z

Link: CVE-2026-57530

cve-icon Vulnrichment

Updated: 2026-07-24T19:47:21.528Z

cve-icon NVD

Status : Deferred

Published: 2026-07-24T20:18:02.893

Modified: 2026-07-27T20:37:34.230

Link: CVE-2026-57530

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T15:00:14Z

Weaknesses
  • CWE-79

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