CVE-2024-28245 KaTeX's \includegraphics does not escape filename

Medium 6.3 Published Updated

KaTeX users rendering untrusted math expressions can suffer arbitrary JavaScript execution via malicious \includegraphics input.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-28245?

CVE-2024-28245 is a medium-severity cross-site scripting vulnerability in KaTeX, published on 25 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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 `\includegraphics` that runs arbitrary JavaScript, or generate invalid HTML. Upgrade to KaTeX v0.16.10 to remove this vulnerability.

Weakness: CWE-116

Which versions are affected by CVE-2024-28245?

2 open source packages ship an affected version, including katex. It affects 1 product.

PackageAffectedFixed in
katex npmFrom 0.11.00.16.10
katex npmFrom 0.11.00.16.10

Products include Katex Katex.

How do I fix CVE-2024-28245?

Upgrade katex to 0.16.10 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-28245 being exploited?

There is no known exploitation of CVE-2024-28245 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-28245, GHSA-f98w-7cxr-ff2h, UBUNTU-CVE-2024-28245.

Is CVE-2024-28245 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free