Intel

AIKIDO-2026-508387

@milkdown/preset-commonmark is vulnerable to Cross-Site Scripting (XSS)

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 15, 2026
July 15, 2026

54

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

The commonmark link mark renders a stored href directly into a clickable anchor in linkSchema.toDOM (also carried into getHTML() output and read-only mode) without validating the URL scheme. An attacker who gets a javascript: or other unsafe-scheme URL stored in a link can cause script execution when the anchor is rendered or clicked. The fix adds a sanitizeLinkHref scheme allowlist (with control-character normalization) and applies it at the anchor rendering sink. The original URL is preserved inert as document text in the serialized markdown.

How do I fix this?

Upgrade the @milkdown/preset-commonmark library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and render markdown or HTML from untrusted or user-supplied sources with the commonmark link schema.

Versions

7.0.0 - 7.21.2

Fixed in 7.21.3

Background info

@milkdown/preset-commonmark is vulnerable to Cross-Site Scripting (XSS) in versions 7.0.0 - 7.21.2.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea