{"id":"CVE-2024-28244","published":"2024-03-25T19:45:50Z","modified":"2024-08-02T00:48:49Z","title":"KaTeX's maxExpand bypassed by Unicode sub/superscripts","vendor":"KaTeX","product":"KaTeX","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02155,"percentile":0.82608,"provenance":"source"},"cwes":[{"id":"CWE-674","name":"Uncontrolled Recursion"}],"references":[{"url":"https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cvr6-37gx-v8wc","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/KaTeX/KaTeX/commit/085e21b5da05414efefa932570e7201a7c70e5b2","tags":["x_refsource_MISC"]}],"priority":{"score":21.1,"factors":[{"name":"EPSS percentile","points":16.52},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"katex","affectedVersions":[{"vendor":"KaTeX","product":"KaTeX","versions":[">= 0.15.4, < 0.16.10"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-03-27T19:31:17.212689Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"katex","vulnerableRanges":[">=0.15.4, <0.16.10"],"patched":["0.16.10"],"from":["GHSA-cvr6-37gx-v8wc"],"provenance":"source"}],"summary":{"text":"KaTeX, the JavaScript library for rendering TeX math on the web, contains a flaw in its macro expansion limit (maxExpand), which is bypassed through Unicode sub- and superscript characters because each such group runs in a separate parser that does not inherit the parent's macro execution count. An attacker who can supply mathematical expressions to a KaTeX renderer with network access and low privileges can use \\def or \\newcommand to trigger a near-infinite loop that exhausts resources, with no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:13:47Z"},"euvd":{"id":"EUVD-2024-0906","exploited":false,"provenance":"source"}}