Skip to content
OpenAdvisories
Medium · 6.5 CVE-2024-28243 EUVD-2024-0839GHSA-64fm-8hw2-v72w

KaTeX's maxExpand bypassed by \edef

Published Mar 25, 2024 · Updated Feb 5, 2026 · 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 `\edef` that causes a near-infinite loop, despite setting `maxExpand` to avoid such loops. This can be used as an availability attack, where e.g. a client rendering another user's KaTeX input will be unable to use the site due to memory overflow, tying up the main thread, or stack overflow. Upgrade to KaTeX v0.16.10 to remove this vulnerability.

Affected products

VendorProductAffectedFixed
KaTeX KaTeX >= 0.12.0, < 0.16.10 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-katex 0.16.10+~cs6.1.0-1 —
Debian 13 node-katex 0.16.10+~cs6.1.0-1 —
Debian 12 node-katex No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS node-katex 0.16.10+~cs6.1.0-2ubuntu0.24.04.1~esm1 USN-7572-1
Ubuntu Pro 22.04 LTS node-katex 0.13.11+~cs6.0.0-2ubuntu0.1~esm1 USN-7572-1

Affected packages

EcosystemPackageAffectedFixedRecord
npm katex >= 0.12.0, < 0.16.10 0.16.10 GHSA-64fm-8hw2-v72w

Advisories 1

References