CVE-2026-57530 in Milkdowninfo

Summary

by MITRE • 07/24/2026

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.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 07/24/2026

This vulnerability exists within the milkdown rich text editor framework prior to version 7.21.3 and represents a critical stored cross-site scripting flaw that can be exploited by attackers with document write permissions. The issue manifests in the milkdown/preset-commonmark and milkdown/components packages where the parseMarkdown runner fails to properly validate URL schemes when processing remark AST nodes. This technical weakness allows malicious actors to inject javascript: URLs directly into document links, creating persistent XSS vectors that can affect any user who interacts with the compromised documents.

The vulnerability stems from inadequate input sanitization mechanisms within the editor's link handling system. Specifically, the DOMPurify.sanitize function in edit-view.ts is called incorrectly, treating raw URL strings as text nodes rather than properly parsing them as HTML attributes. This fundamental flaw in the sanitization process allows javascript: protocol payloads to bypass security checks and remain unmodified throughout the rendering pipeline. The vulnerability affects both the link-tooltip preview component and read-only mode anchor elements, creating multiple attack vectors for exploitation.

The operational impact of this vulnerability is severe as it enables attackers with minimal privileges to compromise user sessions and execute arbitrary JavaScript code in the browser context of document viewers. Users who open affected documents or click on rendered links become victims of persistent XSS attacks that can steal session cookies, redirect users to malicious sites, or perform actions on behalf of the victim. This makes the vulnerability particularly dangerous in collaborative environments where multiple users share documents and have varying permission levels.

This vulnerability maps directly to CWE-79: Cross-Site Scripting and aligns with ATT&CK technique T1213.002: Data from Information Repositories, as it exploits weaknesses in document management systems to execute malicious code. The attack chain follows the typical pattern of privilege escalation through document manipulation followed by user exploitation via rendered content execution. Organizations using milkdown versions prior to 7.21.3 should immediately implement mitigations including updating to the patched version, implementing additional URL validation layers, and conducting security reviews of existing documents that may contain malicious links. The fix requires proper URL scheme validation before storing href attributes and correct implementation of DOMPurify sanitization functions that properly handle HTML attribute contexts rather than treating URLs as plain text nodes.

Responsible

VulnCheck

Reservation

06/24/2026

Disclosure

07/24/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!