CVE-2024-28244: KaTeX's maxExpand bypassed by Unicode sub/superscripts
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.33781%
CWE
Published
3/25/2024
Updated
3/25/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
katex | npm | >= 0.15.4, < 0.16.10 | 0.16.10 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from how Unicode sub/superscript handling was implemented in Parser.js. The original code (pre-patch) created a new Parser instance (new Parser(str, this.settings).parse()
) for each sub/superscript group, which reset the macro expansion counter for each new parser. This violated the intended maxExpand protection by allowing recursive macro expansions across multiple parser instances. The fix replaced this with this.subparse()
which maintains the same parser context and expansion counter. The commit diff and CVE description both explicitly identify this code path as the root cause.