Improper Encoding or Escaping of Output Affecting org.webjars.npm:katex package, versions [0.13.0,]


Severity

Recommended
0.0
medium
0
10

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

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-JAVA-ORGWEBJARSNPM-8647964
  • published20 Jan 2025
  • disclosed17 Jan 2025
  • creditnsysean

Introduced: 17 Jan 2025

NewCVE-2025-23207  (opens in a new tab)
CWE-116  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

org.webjars.npm:katex is a Fast math typesetting for the web.

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output when rendering untrusted mathematical expressions with renderToString due to improper validation of attribute name argument in \htmlData. An attacker can include malicious input using \htmlData, which eventually could result in arbitrary JavaScript execution or generate invalid HTML.

Workaround

  1. Avoid using or turning off the trust option, or set it to forbid \htmlData commands.

  2. Forbid inputs containing the substring "\\htmlData".

  3. Sanitize HTML output from KaTeX.

References

CVSS Scores

version 4.0
version 3.1