Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-66400: CWE-20: Improper Input Validation in syntax-tree mdast-util-to-hast

0
Medium
VulnerabilityCVE-2025-66400cvecve-2025-66400cwe-20cwe-915
Published: Mon Dec 01 2025 (12/01/2025, 22:17:42 UTC)
Source: CVE Database V5
Vendor/Project: syntax-tree
Product: mdast-util-to-hast

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.

AI-Powered Analysis

AILast updated: 12/08/2025, 23:14:19 UTC

Technical Analysis

CVE-2025-66400 affects the mdast-util-to-hast utility, a component of the syntax-tree project that transforms markdown abstract syntax trees (mdast) into hypertext abstract syntax trees (hast). Between versions 13.0.0 and before 13.2.1, the utility improperly validates input by allowing multiple unprefixed classnames to be injected into markdown source through the use of character references. This flaw arises from inadequate sanitization and normalization of class attribute inputs, enabling an attacker to craft markdown content that, when rendered, applies arbitrary CSS classes to code elements. Consequently, user-supplied markdown code blocks can be visually disguised to appear consistent with other page elements, potentially facilitating UI spoofing or misleading users about the origin or nature of displayed content. The vulnerability is classified under CWE-20 (Improper Input Validation) and CWE-915 (Improperly Controlled Modification of Object Prototype Attributes), highlighting the root cause as insufficient input checks. Exploitation requires no privileges or user interaction and can be performed remotely by submitting malicious markdown content. The vulnerability was publicly disclosed on December 1, 2025, with a CVSS 4.0 base score of 6.9 (medium severity). The issue is resolved in mdast-util-to-hast version 13.2.1, which properly sanitizes classnames and prevents injection via character references. No known active exploits have been reported to date.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to web applications and services that process and render user-generated markdown content using affected versions of mdast-util-to-hast. The ability to inject multiple unprefixed classnames can lead to UI confusion or spoofing attacks, undermining the integrity of displayed content and potentially deceiving users into trusting malicious or altered information. This could facilitate social engineering, phishing, or misinformation campaigns, especially in sectors relying heavily on markdown for documentation, collaboration platforms, or content management systems. While the vulnerability does not directly compromise confidentiality or availability, the integrity and trustworthiness of rendered content are at risk. Organizations in finance, government, media, and critical infrastructure sectors may face reputational damage or operational disruption if attackers exploit this flaw to mislead users or inject deceptive content. The lack of required authentication or user interaction lowers the barrier for exploitation, increasing the threat surface. However, the absence of known exploits in the wild suggests limited active targeting so far, though proactive mitigation is advised.

Mitigation Recommendations

European organizations should immediately upgrade all instances of mdast-util-to-hast to version 13.2.1 or later, where the vulnerability is fixed. For environments where immediate upgrade is not feasible, implement input sanitization and validation layers upstream to detect and neutralize character references that could inject unprefixed classnames. Employ Content Security Policy (CSP) headers to restrict the application of unauthorized CSS classes or styles, limiting the impact of injected classnames. Conduct thorough code reviews and security testing on markdown rendering pipelines to identify and remediate similar input validation weaknesses. Monitor markdown content submissions for anomalous patterns indicative of exploitation attempts. Additionally, educate developers and content managers about the risks of rendering untrusted markdown and encourage the use of secure libraries and frameworks. Maintain up-to-date dependency management practices and subscribe to vulnerability advisories related to syntax-tree and markdown processing tools.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2025-11-28T23:33:56.364Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 692e15786dbd3477d7482169

Added to database: 12/1/2025, 10:23:52 PM

Last enriched: 12/8/2025, 11:14:19 PM

Last updated: 1/16/2026, 3:05:12 AM

Views: 80

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats