CVE-2025-66400
JSON

6.9medium

mdast-util-to-hast unsanitized class attribute

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.33% (higher than 27% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4fh9-h7wg-q85m

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.

Affected

Product or packageVersionsReported by
syntax-tree mdast-util-to-hast>= 13.0.0, < 13.2.1CVE List
mdast-util-to-hast (npm)from 13.0.0 before 13.2.1GitHub Advisory Database
unifiedjs mdast-util-to-hastfrom 13.0.0 before 13.2.1NVD

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Classification

CWE-20CWE-915

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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. The following markdown:

```js&#x20;xss
```

Would create <pre><code class="language-js xss"></code></pre> If your page then applied .xss classes (or listeners in JS), those apply to this element. For more info see https://github.com/ChALkeR/notes/blob/master/Improper-markup-sanitization.md#unsanitized-class-attribute

Patches

The bug was patched. When using regular semver, run npm install. For exact ranges, make sure to use 13.2.1.

Workarounds

Update.

References
NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-66400 changed 2025-12-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-4fh9-h7wg-q85m changed 2026-09-10CC-BY-4.0
NVDCVE-2025-66400 changed 2026-10-18Public domain