Skip to content
OpenAdvisories
Medium · 6.3 CVE-2025-23207 EUVD-2025-0112GHSA-cg87-wmx4-v546

\htmlData does not validate attribute names in KaTeX

Published Jan 17, 2025 · Updated Jan 17, 2025 · Assigned by GitHub_M

Description

KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. KaTeX users who render untrusted mathematical expressions with `renderToString` could encounter malicious input using `\htmlData` that runs arbitrary JavaScript, or generate invalid HTML. Users are advised to upgrade to KaTeX v0.16.21 to remove this vulnerability. Users unable to upgrade should avoid use of or turn off the `trust` option, or set it to forbid `\htmlData` commands, forbid inputs containing the substring `"\\htmlData"` and sanitize HTML output from KaTeX.

Affected products

VendorProductAffectedFixed
KaTeX KaTeX >= 0.12.0, < 0.16.21 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-katex 0.16.10+~cs6.1.0-7 —
Debian 13 node-katex No fix yet —
Debian 12 node-katex No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.04 LTS node-katex 0.16.10+~cs6.1.0-2ubuntu1 —
Ubuntu 25.10 node-katex 0.16.10+~cs6.1.0-2ubuntu1 —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS node-katex 0.16.10+~cs6.1.0-2ubuntu0.24.04.1~esm1 USN-7572-1
Ubuntu Pro 22.04 LTS node-katex 0.13.11+~cs6.0.0-2ubuntu0.1~esm1 USN-7572-1

Affected packages

EcosystemPackageAffectedFixedRecord
npm katex >= 0.12.0, < 0.16.21 0.16.21 GHSA-cg87-wmx4-v546

Advisories 2

References