CVE-2025-23207Katex
High 7.2 No auth needed
Follow: this CVE · Katex · Katex We alert you by email or Slack (account required).
- Priority
- 58
- CVSS 3.1
- 7.2
- EPSS
- —
- Auth required
- No
- Published
- Jan 17, 2025
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Katex.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | katex |
≥ 0.12.0 < 0.16.21 |
0.16.21 |
npm install katex@0.16.21 |
Per OSV / GitHub Advisories (GHSA-cg87-wmx4-v546). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| katex | katex | ≥ 0.12.0 < 0.16.21 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Third Party Advisory