Improper Encoding or Escaping of Output Affecting katex package, versions >=0.11.0 <0.16.10


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-KATEX-6483831
  • published26 Mar 2024
  • disclosed25 Mar 2024
  • creditmartinvks

Introduced: 25 Mar 2024

CVE-2024-28245  (opens in a new tab)
CWE-116  (opens in a new tab)

How to fix?

Upgrade katex to version 0.16.10 or higher.

Overview

katex is a Fast math typesetting for the web.

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output when handling the \includegraphics command. An attacker can execute arbitrary JavaScript or generate invalid HTML by exploiting the lack of proper filename escaping in the \includegraphics command.

Note:

This is only exploitable if the trust option is enabled or not properly configured to restrict the \includegraphics commands.

Workaround

This vulnerability can be mitigated by either avoiding the use of or turning off the trust option, setting it to forbid \includegraphics commands, forbidding inputs containing the substring "\\includegraphics", or sanitizing HTML output from the package.

References

CVSS Scores

version 3.1