CVE-2024-28243
Medium · 6.5CVSS
6.5
EPSS
1.4%
Published
Mar 25, 2024
CISA due date
—
Cloudanix analysis
A website feature that shows math equations can be tricked into freezing up when someone submits specially crafted equations, making the site slow or unusable for everyone.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
KaTeX rendering of untrusted math expressions with \edef bypasses maxExpand protections and triggers a near-infinite loop, causing memory exhaustion, main-thread blocking, or stack overflow.
Why it matters to the business
Attackers can render sites or applications using KaTeX (including Chamilo) unresponsive or crashed by submitting malicious math input, disrupting user access and availability until resources are recovered.
How an attack unfolds
An attacker supplies a crafted mathematical expression containing \edef to any web application that renders user-provided KaTeX content; the renderer enters an uncontrolled loop despite configured limits, exhausting memory or CPU and denying service to other users.
How to fix it
Upgrade KaTeX to version 0.16.10 or later. For Chamilo, apply the fix at commit 814049e5bd5317d761dda0ebbbc519cb2a64ab6c.
How to confirm the fix worked
Confirm the deployed KaTeX library reports version 0.16.10+; in Chamilo verify the presence of commit 814049e5bd5317d761dda0ebbbc519cb2a64ab6c in the relevant source tree.
Typical attack path
- Identify a target application that accepts and renders untrusted KaTeX input (e.g., Chamilo)
- Submit a math expression containing \edef that evades maxExpand checks
- Renderer enters near-infinite loop, exhausting resources
- Application or page becomes unresponsive or crashes
How to detect it
Review web application and rendering logs for repeated submissions of expressions containing \edef; correlate with spikes in CPU or memory usage on processes handling KaTeX.
- \edef
- maxExpand
- katex.js
What your security team should do
- Immediately update Chamilo to the fixed commit or a later release
- Temporarily disable or restrict user-supplied math rendering until patched
- Add input validation or rate limiting around KaTeX rendering endpoints
The record
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 packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| npm | katex | 0.10.0-beta | 0.16.10 |
| npm | katex | 0.12.0 | 0.16.10 |
| Debian:11 | node-katex | 0 | No fix |
| Debian:12 | node-katex | 0 | No fix |
| Debian:13 | node-katex | 0 | 0.16.10+~cs6.1.0-1 |
| Ubuntu:20.04:LTS | node-katex | 0 | No fix |
| Ubuntu:22.04:LTS | node-katex | 0 | No fix |
| Ubuntu:24.04:LTS | node-katex | 0 | No fix |
| Ubuntu:24.10 | node-katex | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | node-katex | 0 | No fix |
| Ubuntu:Pro:22.04:LTS | node-katex | 0 | 0.13.11+~cs6.0.0-2ubuntu0.1~esm1 |
Related vulnerabilities
- CVE-2025-23207 KaTeX \htmlData does not validate attribute names Also affects katex
- CVE-2026-92822 A flaw was found in libmodulemd. CWE-674
- CVE-2026-112895 Pillow is a Python imaging library. CWE-674
- CVE-2026-100354 kin-openapi is a Go project for handling OpenAPI files. CWE-674
- CVE-2026-109267 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a stack overflow in the MSL… CWE-674
- CVE-2026-109264 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains uncontrolled recursion in… CWE-674
- CVE-2026-107678 FFmpeg through 9.0.2 contains a stack exhaustion vulnerability in… CWE-674
- CVE-2026-107208 ImageMagick is free and open-source software used for editing and manipulating digital… CWE-674