{"id":"CVE-2025-66400","aliases":["CVE-2025-66400","GHSA-4fh9-h7wg-q85m"],"related":[],"kind":"vulnerability","state":"published","title":"mdast-util-to-hast unsanitized class attribute","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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&#x20;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","format":"markdown","source":"ghsa"},{"lang":"es","text":"mdast-util-to-hast es una utilidad de mdast para transformar a hast. Desde la 13.0.0 hasta la 13.2.1, múltiples nombres de clase (sin prefijo) podían añadirse en el código fuente de markdown mediante el uso de referencias de caracteres. Esto podría hacer que los elementos de código markdown renderizados y proporcionados por el usuario aparecieran como el resto de la página. Esta vulnerabilidad está corregida en la 13.2.1.","source":"nvd"}],"published":"2025-12-01T22:17:42.705Z","modified":"2026-10-18T18:10:00.100Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-915"],"affected":[{"ranges":[{"version":">= 13.0.0, < 13.2.1","status":"affected"}],"vendor":"syntax-tree","product":"mdast-util-to-hast","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"13.0.0","status":"affected","fixed":"13.2.1"}],"ecosystem":"npm","package":"mdast-util-to-hast","purl":"pkg:npm/mdast-util-to-hast","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"13.0.0","fixed":"13.2.1"}],"vendor":"unifiedjs","product":"mdast-util-to-hast","cpe":"cpe:2.3:a:unifiedjs:mdast-util-to-hast:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/syntax-tree/mdast-util-to-hast/security/advisories/GHSA-4fh9-h7wg-q85m","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/syntax-tree/mdast-util-to-hast/commit/6fc783ae6abdeb798fd5a68e7f3f21411dde7403","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/syntax-tree/mdast-util-to-hast/commit/ab3a79570a1afbfa7efef5d4a0cd9b5caafbc5d7","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66400","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/syntax-tree/mdast-util-to-hast","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-12-02T15:34:16.267Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66400","url":"https://www.cve.org/CVERecord?id=CVE-2025-66400","licence":"CVE Terms of Use","modified":"2025-12-02T15:34:24.293Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4fh9-h7wg-q85m","url":"https://github.com/advisories/GHSA-4fh9-h7wg-q85m","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:31.288Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66400","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66400","licence":"Public domain","modified":"2026-10-18T18:10:00.100Z"}],"updatedAt":"2026-11-25T22:59:08.150Z","epss":{"score":0.00327,"percentile":0.27781,"date":"2026-12-01T12:00:22.000Z"}}