CVE-2024-28245: KaTeX's \includegraphics does not escape filename
Impact KaTeX users who render untrusted mathematical expressions could encounter malicious input using \includegraphics that runs arbitrary JavaScript, or generate invalid HTML.
Patches Upgrade to KaTeX v0.16.10 to remove this vulnerability.
Workarounds Avoid use of or turn off the trust option, or set it to forbid \includegraphics commands. Forbid inputs containing the substring "\\includegraphics". Sanitize HTML output from KaTeX.
Details \includegraphics did not properly quote its filename argument, allowing it to generate invalid or malicious HTML that runs scripts.
For more information If you have any questions or comments about this advisory:
Open an issue or security advisory in the KaTeX repository Email us at katex-security@mit.edu
Other sources
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.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-28245?
CVE-2024-28245 has a high severity due to its potential for executing arbitrary JavaScript from untrusted mathematical expressions.
How do I fix CVE-2024-28245?
To fix CVE-2024-28245, upgrade to KaTeX version 0.16.10 or later.
What kind of impact does CVE-2024-28245 have?
CVE-2024-28245 allows malicious input via \includegraphics to execute JavaScript or produce invalid HTML, potentially leading to security risks.
Who is affected by CVE-2024-28245?
Users of KaTeX who render untrusted mathematical expressions are affected by CVE-2024-28245.
Are there workarounds for CVE-2024-28245?
The primary recommendation is to upgrade to the patched version, but avoiding the use of \includegraphics in untrusted contexts may serve as a temporary workaround.