# CVE-2024-28244: KaTeX's maxExpand bypassed by Unicode sub/superscripts

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.15%, higher than 82% of CVEs (2026-12-01)
- Published: 2024-03-25T19:38:29.000Z
- Modified: 2026-09-10T03:50:10.288Z
- Also known as: GHSA-cvr6-37gx-v8wc
- Weaknesses: CWE-606, CWE-674
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- KaTeX KaTeX: >= 0.15.4, < 0.16.10; from 0.15.4 before 0.16.10
- katex (npm): from 0.15.4 before 0.16.10

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cvr6-37gx-v8wc> (third-party-advisory, web)
- <https://github.com/KaTeX/KaTeX/commit/085e21b5da05414efefa932570e7201a7c70e5b2> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-28244> (advisory)
- <https://github.com/KaTeX/KaTeX> (package)

## Sources

- CVE List: [CVE-2024-28244](https://www.cve.org/CVERecord?id=CVE-2024-28244), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-cvr6-37gx-v8wc](https://github.com/advisories/GHSA-cvr6-37gx-v8wc), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-28244](https://nvd.nist.gov/vuln/detail/CVE-2024-28244), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-28244 · Whole record: https://cve.day/CVE-2024-28244.json · Rebuilt by cve.day 2026-11-25T22:58:37.885Z
