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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | katex | >= 0.12.0, < 0.16.21 | 0.16.21 | GHSA-cg87-wmx4-v546 |
Advisories 2
- USN-7572-1 node-katex vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- WID-SEC-2025-0557 Red Hat OpenShift Dev Spaces: Schwachstelle ermöglicht Codeausführung BSI CERT-Bund (WID) · Mar 13, 2025