Critical Availability Attack Vulnerability in node-katex: Untrusted Input Handling

node-katex Updated 02 Oct 2025

Summary

25/03/2024
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2024-28243: KaTeX is a JavaScript library for TeX math rendering on the web. Affects node-katex versions < 0.16.10+~cs6.1.0-1. Fixed in 0.16.10+~cs6.1.0-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

node-katex is a JavaScript library designed for rendering TeX math expressions on the web. It allows users to display complex mathematical formulas in a visually appealing manner. However, this package has been found to be vulnerable to a specific issue where untrusted mathematical expressions can lead to denial of service due to improper handling of certain commands.

Vulnerability Detail

The vulnerability arises from the way node-katex processes untrusted input, particularly with the \edef command. When users render mathematical expressions that include this command, it can trigger a near-infinite loop, even if the maxExpand setting is configured to prevent such scenarios. This can result in significant resource consumption, leading to memory overflow, tying up the main thread, or causing a stack overflow. Consequently, this vulnerability poses a risk of availability attacks, where users may find themselves unable to access the site due to the excessive resource usage caused by malicious input.

How To Fix

Minimum fixed version

0.16.10+~cs6.1.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-katex

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can implement input validation to sanitize mathematical expressions before rendering them with node-katex. This can help mitigate the risk of malicious input causing resource exhaustion.

Conclusion

The vulnerability in node-katex poses a significant risk by allowing untrusted input to cause denial of service. Users are advised to upgrade to the patched version to secure their applications. Implementing input validation can serve as a temporary workaround until the upgrade is completed.

See every vulnerability recorded for node-katex →

Share this vulnerability

FAQ

The vulnerability allows untrusted mathematical expressions to cause denial of service through resource exhaustion.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time based on your manifest file.

If an immediate upgrade is not possible, implement input validation to sanitize user inputs as a temporary measure.

Yes, you can update node-katex by running 'sudo apt-get install node-katex=0.16.10+~cs6.1.0-1' in your terminal.

More information can be found in the official Debian CVE database or by visiting the Vulert website.

Related vulnerabilities

Recent vulnerabilities recorded for node-katex.

How To Fix

Minimum fixed version

0.16.10+~cs6.1.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-katex

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback