CVE-2024-28244Katex
Medium 6.5
Follow: this CVE · Katex · Katex We alert you by email or Slack (account required).
- Priority
- 39
- CVSS 3.1
- 6.5
- EPSS
- 3.0% probability of exploitation in 30 days · percentile 88
- Auth required
- Yes
- Published
- Mar 25, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-674
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
What happens
KaTeX is a JavaScript library for TeX math rendering on the web. KaTeX users who render untrusted mathematical expressions could encounter malicious input using `\def` or `\newcommand` that causes a near-infinite loop, despite setting `maxExpand` to avoid such loops. KaTeX supports an option named maxExpand which aims to prevent infinitely recursive macros from consuming all available memory and/or triggering a stack overflow error. Unfortunately, support for "Unicode (sub|super)script characters" allows an attacker to bypass this limit. Each sub/superscript group instantiated a separate Parser with its own limit on macro executions, without inheriting the current count of macro executions from its parent. This has been corrected in KaTeX v0.16.10.
What to do
- Apply the vendor's security update for Katex.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | katex |
≥ 0.15.4 < 0.16.10 |
0.16.10 |
npm install katex@0.16.10 |
Per OSV / GitHub Advisories (GHSA-cvr6-37gx-v8wc). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| katex | katex | ≥ 0.15.4 < 0.16.10 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- github.com Third Party Advisory