Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.
Open advisories
6 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.
Impact KaTeX can act as a read-side prototype pollution gadget in applications where Object.prototype has already been polluted, or where an attacker can influence the prototype of the renderer options object. (KaTeX does not enable said prototype pollution. This advisory applies when combining KaTeX with other vulnerable software that allows for prototype pollution.) Affected versions may treat inherited properties from Object.prototype as renderer options, internal setting metadata, or namespace entries. In particular, an inherited trust value will be treated as though the application explicitly enabled trusted rendering, rather than using the documented default of false. With attacker-controlled mathematical expressions, this can produce links capable of user-interaction cross-site scripting or load attacker-selected external resources. Exploitation requires the consuming application to insert KaTeX output into a web page without a separate sanitizer. (KaTeX does not execute…
Recommended action: Upgrade to 0.18.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact KaTeX users who render untrusted mathematical expressions with renderToString could encounter malicious input using \htmlData that runs arbitrary JavaScript, or generate invalid HTML. Patches Upgrade to KaTeX v0.16.21 to remove this vulnerability. Workarounds - Avoid use of or turn off the trust option, or set it to forbid \htmlData commands. - Forbid inputs containing the substring "\\htmlData". - Sanitize HTML output from KaTeX. Details \htmlData did not validate its attribute name 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
Recommended action: Upgrade to 0.16.21 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact Code that uses KaTeX's trust option, specifically that provides a function to block-list certain URL protocols, can be fooled by URLs in malicious inputs that use uppercase characters in the protocol. In particular, this can allow for malicious input to generate javascript: links in the output, even if the trust function tries to forbid this protocol via trust: (context) = context.protocol !== 'javascript'. Patches Upgrade to KaTeX v0.16.10 to remove this vulnerability. Workarounds Allow-list instead of block protocols in your trust function. Manually lowercase context.protocol via context.protocol.toLowerCase() before attempting to check for certain protocols. Avoid use of or turn off the trust option. Details KaTeX did not normalize the protocol entry of the context object provided to a user-specified trust-function, so it could be a mix of lowercase and/or uppercase letters. It is generally better to allow-list by protocol, in which case this would normally not be an issue.…
Recommended action: Upgrade to 0.16.10 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
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
Recommended action: Upgrade to 0.16.10 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact KaTeX users who render untrusted mathematical expressions could encounter malicious input using \def or \newcommand that causes a near-infinite loop, despite setting maxExpand to avoid such loops. This can be used as an availability attack, where e.g. a client rendering another user's KaTeX input will be unable to use the site due to memory overflow, tying up the main thread, or stack overflow. Patches Upgrade to KaTeX v0.16.10 to remove this vulnerability. Workarounds Forbid inputs containing any of the characters ₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸⁹ᵃᵇᶜᵈᵉᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘʷˣʸᶻᵛᵝᵞᵟᵠᵡ before passing them to KaTeX. (There is no easy workaround for the auto-render extension.) Details KaTeX supports an option named maxExpand which aims to prevent infinitely recursive macros from consuming all available memory and/or triggering a stack overflow error. Unfortunately, support for "Unicode (sub|super)script characters" allows an attacker to bypass this limit. Each…
Recommended action: Upgrade to 0.16.10 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
Impact 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. a client rendering another user's KaTeX input will be unable to use the site due to memory overflow, tying up the main thread, or stack overflow. Patches Upgrade to KaTeX v0.16.10 to remove this vulnerability. Workarounds Forbid inputs containing the substring "\\edef" before passing them to KaTeX. (There is no easy workaround for the auto-render extension.) Details KaTeX supports an option named maxExpand which prevents infinitely recursive macros from consuming all available memory and/or triggering a stack overflow error. However, what counted as an "expansion" is a single macro expanding to any number of tokens. The expand-and-define TeX command \edef can be used to build up an exponential number of tokens using only a linear number of…
Recommended action: Upgrade to 0.16.10 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.