CVE-2024-28245
JSON

6.3medium

KaTeX's \includegraphics does not escape filename

Severity
6.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.55% (higher than 40% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-f98w-7cxr-ff2h

Description

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.

Affected

Product or packageVersionsReported by
KaTeX KaTeX>= 0.11.0, < 0.6.10, from 0.11.0 before 0.16.10CVE List, NVD
katex (npm)from 0.11.0 before 0.16.10GitHub Advisory Database

All scores

GitHub_M6.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
GitHub6.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-116

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database
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:

NVD (es)

KaTeX es una librería de JavaScript para la representación matemática de TeX en la web. Los usuarios de KaTeX que representan expresiones matemáticas que no son de confianza podrían encontrar entradas maliciosas utilizando `\includegraphics` que ejecuta JavaScript arbitrario o generar HTML no válido. Actualice a KaTeX v0.16.10 para eliminar esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-28245 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-f98w-7cxr-ff2h changed 2026-09-10CC-BY-4.0
NVDCVE-2024-28245 changed 2026-06-17Public domain