Vulnerability library
Security checkFebruary 05, 2026

KaTeX's maxExpand bypassed by `\edef`

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmkatex

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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.

Recommendation

Update the katex package to the latest compatible version. Followings are version details:

  • Affected version(s): >= 0.12.0, < 0.16.10
  • Patched version(s): 0.16.10

References

Could your website be exposed too?

SmartScanner can check your website for KaTeX's maxExpand bypassed by `\edef` and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated February 05, 2026