CVE-2025-66400: Mdast util to hast Mdast-util-to-hast Has Unsanitized Class Attribute Vulnerability
MODERATECVE-2025-66400 is a MODERATE (CVSS 5.3) mdast-util-to-hast has unsanitized class attribute vulnerability (CWE-20: Improper Input Validation) affecting Mdast util to hast libraries in the npm ecosystem. The issue involves mdast-util-to-hast has unsanitized class attribute. Remediation is available by upgrading affected packages to version 13.2.1.
CVE-2025-66400 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2025-66400
To remediate this vulnerability, upgrade all affected Mdast util to hast dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install mdast-util-to-hast@13.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mdast-util-to-hast
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-66400, inspect your project dependencies using npm:
npm ls mdast-util-to-hast
Analyze the terminal output to locate any version of Mdast util to hast in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 13.2.1), your application is affected.
Note: The npm ls mdast-util-to-hast command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Mdast util to hast, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-66400 Affected Mdast util to hast Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mdast-util-to-hast
|
npm |
≥ 13.0.0
< 13.2.1
|
13.2.1
|
References
Frequently Asked Questions
What is CVE-2025-66400?
Which Mdast util to hast versions are affected?
What version fixes CVE-2025-66400?
Is mdast-util-to-hast affected?
What is the CVSS score of CVE-2025-66400?
What CWE is associated with CVE-2025-66400?
How can I check npm dependencies for CVE-2025-66400?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4fh9-h7wg-q85m",
"modified" : "2026-02-06T19:00:13Z",
"published" : "2025-12-02T01:25:46Z",
"aliases" : [ "CVE-2025-66400" ],
"summary" : "mdast-util-to-hast has unsanitized class attribute",
"details" : "### Impact\n\nMultiple (unprefixed) classnames could be added in markdown source by using character references.\nThis could make rendered user supplied markdown `code` elements appear like the rest of the page.\nThe following markdown:\n\n````markdown\n```js xss\n```\n````\n\nWould create `<pre><code class=\"language-js xss\"></code></pre>`\nIf your page then applied `.xss` classes (or listeners in JS), those apply to this element.\nFor more info see <https://github.com/ChALkeR/notes/blob/master/Improper-markup-sanitization.md#unsanitized-class-attribute>\n\n### Patches\n\nThe bug was patched. When using regular semver, run `npm install`. For exact ranges, make sure to use `13.2.1`.\n\n### Workarounds\n\nUpdate.\n\n### References\n\n* bug introduced in https://github.com/syntax-tree/mdast-util-to-hast/commit/6fc783ae6abdeb798fd5a68e7f3f21411dde7403\n* bug fixed in https://github.com/syntax-tree/mdast-util-to-hast/commit/ab3a79570a1afbfa7efef5d4a0cd9b5caafbc5d7",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mdast-util-to-hast"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "13.0.0"
}, {
"fixed" : "13.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/syntax-tree/mdast-util-to-hast/security/advisories/GHSA-4fh9-h7wg-q85m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66400"
}, {
"type" : "WEB",
"url" : "https://github.com/syntax-tree/mdast-util-to-hast/commit/6fc783ae6abdeb798fd5a68e7f3f21411dde7403"
}, {
"type" : "WEB",
"url" : "https://github.com/syntax-tree/mdast-util-to-hast/commit/ab3a79570a1afbfa7efef5d4a0cd9b5caafbc5d7"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/syntax-tree/mdast-util-to-hast"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-915" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-12-02T01:25:46Z",
"nvd_published_at" : "2025-12-01T23:15:53Z"
}
}