GitHub Advisoryadvisory · npm

GHSA-f98w-7cxr-ff2h KaTeX's `\includegraphics` does not escape filename

MEDIUM Published 2024-03-25 Modified 2024-03-25 Official page ↗
Aliases
CVE-2024-28245
Ecosystem
npm
Packages
katex
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Weaknesses
CWE-116
Reviewed
2024-03-25

Affected packages

• npm katex: >= 0.11.0, < 0.16.10 → fixed in 0.16.10

Description

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 [email protected]

Related

Alias · CVE (1)

  • CVE-2024-28245 KaTeX is a JavaScript library for TeX math rendering on the web. vulnerability

Weakness · CWE (1)

  • CWE-116 Improper Encoding or Escaping of Output weakness

References