KaTeX's maxExpand bypassed by Unicode sub/superscripts
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-674.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| KaTeX | KaTeX | 0.15.4 to before 0.16.10 | 0.16.10 | Patch available | CNA |
| — | katex (npm) | 0.15.4 to before 0.16.10 | 0.16.10 | Patch available | GHSA-cvr6-37gx-v8wc |
- KaTeX VendorKaTeX Affected 0.15.4 to before 0.16.10 Fixed in 0.16.10 Patch available CNA
- katex (npm) Vendor— Affected 0.15.4 to before 0.16.10 Fixed in 0.16.10 Patch available GHSA-cvr6-37gx-v8wc
Remediation
- Fix · CNA KaTeX (KaTeX) Fixed in 0.16.10
- Fix · GHSA-cvr6-37gx-v8wc katex (npm) Fixed in 0.16.10 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2024-28244
- 2026-10-03 Alias added: GHSA-cvr6-37gx-v8wc
References
More Katex vulnerabilities
- TI-2025-16992 \htmlData does not validate attribute names in KaTeX CVSS 3.1HIGH 7.2
- TI-2024-18802 KaTeX's maxExpand bypassed by \edef CVSS 3.1MEDIUM 6.5
- TI-2024-18804 KaTeX's \includegraphics does not escape filename CVSS 3.1MEDIUM 6.3
- TI-2024-18805 KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols CVSS 3.1MEDIUM 5.5
Sources
- CVE-2024-28244 · CVE Program
- CVE-2024-28244 · NVD
- FIRST EPSS
- GHSA-cvr6-37gx-v8wc · GitHub Advisory Database · CC BY 4.0
- CVE-2024-28244 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences