CVE-2025-66400 mdast-util-to-hast unsanitized class attribute

Medium 6.9 Published Updated

Attackers can inject unprefixed class names into rendered markdown, potentially disguising malicious elements as legitimate page content.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-66400?

CVE-2025-66400 is a medium-severity cross-site scripting vulnerability in syntax-tree mdast-util-to-hast, published on 1 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

mdast-util-to-hast is an mdast utility to transform to hast. From 13.0.0 to before 13.2.1, multiple (unprefixed) classnames could be added in markdown source by using character references. This could make rendered user supplied markdown code elements appear like the rest of the page. This vulnerability is fixed in 13.2.1.

Weakness: CWE-915, CWE-20

Which versions are affected by CVE-2025-66400?

2 open source packages ship an affected version, including mdast-util-to-hast. It affects 1 product.

PackageAffectedFixed in
mdast-util-to-hast npmFrom 13.0.013.2.1
mdast-util-to-hast npmFrom 13.0.013.2.1

Products include Unifiedjs Mdast-Util-to-Hast.

How do I fix CVE-2025-66400?

Upgrade mdast-util-to-hast to 13.2.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-66400 being exploited?

There is no known exploitation of CVE-2025-66400 in the wild and no public exploit code.

Sources

Also known as GHSA-4fh9-h7wg-q85m, MINI-3q6c-x3c8-36q7.

Is CVE-2025-66400 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free