CVE-2024-28243
JavaScript vulnerability analysis and mitigation

Overview

KaTeX, a JavaScript library for TeX math rendering on the web, was found to contain a vulnerability (CVE-2024-28243) where untrusted mathematical expressions could bypass the maxExpand setting using \edef to cause a near-infinite loop. The vulnerability was discovered and disclosed on March 24, 2024, affecting KaTeX versions from v0.10.0-beta to versions prior to v0.16.10 (GitHub Advisory).

Technical details

The vulnerability stems from a flaw in how KaTeX counted macro expansions against its maxExpand limit. Previously, a single macro expanding to any number of tokens was counted as one expansion. The \edef command could be exploited to build up an exponential number of tokens using only a linear number of expansions, effectively bypassing the maxExpand protection mechanism. The vulnerability has been assigned a CVSS v3.1 base score of 6.5 (Medium) with a vector of CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H (GitHub Advisory).

Impact

The vulnerability can be exploited as an availability attack. When rendering untrusted KaTeX input, a malicious expression could cause memory overflow, tie up the main thread, or trigger stack overflow, potentially making the site unusable for clients rendering the malicious content (GitHub Advisory).

Exploitability

The vulnerability can be exploited by providing malicious input containing \edef commands that create an exponential expansion of tokens. The attack requires the ability to submit mathematical expressions to a system using KaTeX for rendering (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in KaTeX version 0.16.10, which now counts every expanded token in an \edef as an expansion. For users unable to upgrade immediately, a workaround is available by forbidding inputs containing the substring "\edef" before passing them to KaTeX. However, this workaround is not easily applicable to the auto-render extension (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-73421CRITICAL9.1
  • JavaScript logoJavaScript
  • next-auth
NoYesAug 13, 2026
CVE-2026-73420CRITICAL9.1
  • JavaScript logoJavaScript
  • next-auth
NoYesAug 13, 2026
CVE-2026-73305HIGH8.8
  • JavaScript logoJavaScript
  • @budibase/server
NoNoAug 13, 2026
CVE-2026-73408HIGH7.6
  • JavaScript logoJavaScript
  • @budibase/server
NoNoAug 13, 2026
CVE-2026-73428MEDIUM4.6
  • JavaScript logoJavaScript
  • action_text-trix
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management