CVE-2024-28244 KaTeX's maxExpand bypassed by Unicode sub/superscripts
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
Description
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.
Upgrade path
7 packages: 6 fixed, 1 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/node-katex(Debian 12) | = 0.16.4+~cs6.1.0-1; = 0.16.10+~cs6.1.0-1; = 0.16.10+~cs6.1.0-2; = 0.16.10+~cs6.1.0-3 +8 more | No fix listed | No fix yet |
| debian/node-katex(Debian 13) | < 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 | Fixed |
| debian/node-katex(Debian 14) | < 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 | Fixed |
| KaTeX | = >= 0.15.4, < 0.16.10; >= 0.15.4, < 0.16.10 | 0.16.10 | Fixed |
| npm katex(npm) | >= 0.15.4, < 0.16.10 | 0.16.10 | Fixed |
| ubuntu/node-katex(Ubuntu 24.04) | < 0.16.10+~cs6.1.0-2; = 0.16.4+~cs6.1.0-1 | 0.16.10+~cs6.1.0-2 | Fixed |
| ubuntu/node-katex(Ubuntu 25.04) | < 0.16.10+~cs6.1.0-2 | 0.16.10+~cs6.1.0-2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| npm katex(npm) | >= 0.15.4, < 0.16.10 | 0.16.10 |
| debian/node-katex(Debian:12) | All versions | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-1 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-10 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-2 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-3 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-4 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-5 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-6 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-7 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-8 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.10+~cs6.1.0-9 | No fix listed |
| debian/node-katex(Debian:12) | = 0.16.4+~cs6.1.0-1 | No fix listed |
| debian/node-katex(Debian:13) | < 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 |
| debian/node-katex(Debian:14) | < 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 |
| KaTeX | = >= 0.15.4, < 0.16.10 | No fix listed |
| KaTeX | >= 0.15.4, < 0.16.10 | 0.16.10 |
| ubuntu/node-katex(Ubuntu:24.04) | < 0.16.10+~cs6.1.0-2 | 0.16.10+~cs6.1.0-2 |
| ubuntu/node-katex(Ubuntu:24.04) | = 0.16.4+~cs6.1.0-1 | No fix listed |
| ubuntu/node-katex(Ubuntu:25.04) | < 0.16.10+~cs6.1.0-2 | 0.16.10+~cs6.1.0-2 |
References
- https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cvr6-37gx-v8wc issue-tracking third-party-advisory vendor-advisory
- https://github.com/KaTeX/KaTeX/commit/085e21b5da05414efefa932570e7201a7c70e5b2 issue-tracking patch
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- Debian Security Tracker CVE-2024-28244 vendor-advisory
- bugs.debian.org issue-tracking
- github.com product
- ubuntu.com issue-tracking
- www.cve.org issue-tracking