katex
Ecosystem: npm
Downloads: 135.81 Mln
- 0CriticalAffects 0 versions
- 0HighAffects 0 versions
- 0MediumAffects 0 versions
- 5ModerateAffects 5 versions
- 1LowAffects 1 version
- Critical0 (0.0%)
- High0 (0.0%)
- Medium0 (0.0%)
- Moderate5 (83.3%)
- Low1 (16.7%)
Monthly breakdown
- Critical
- High
- Medium
- Moderate
- Low
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 0
- Low: 1
- 1 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 4 vulnerabilities
- Critical: 0
- High: 0
- Medium: 0
- Moderate: 4
- Low: 0
Vulnerabilities (6)
Known vulnerabilities affecting katex, based on data from OSV.
| ID | Severity | Summary | Affected versions | Published | Source |
|---|---|---|---|---|---|
| GHSA-238p-pmpm-9mq7 | Low | KaTeX: Existing prototype pollution can bypass trust restrictions### 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 applic |
| GitHub (opens in a new tab) | |
| GHSA-cg87-wmx4-v546 | Moderate | KaTeX \htmlData does not validate attribute names### 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 scr |
| GitHub (opens in a new tab) | |
| GHSA-3wc5-fcw2-2329 | Moderate | KaTeX missing normalization of the protocol in URLs allows bypassing forbidden protocols### 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 lower |
| GitHub (opens in a new tab) | |
| GHSA-64fm-8hw2-v72w | Moderate | KaTeX's maxExpand bypassed by `\edef`### 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 th |
| GitHub (opens in a new tab) | |
| GHSA-cvr6-37gx-v8wc | Moderate | KaTeX's maxExpand bypassed by Unicode sub/superscripts### 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 `₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸ |
| GitHub (opens in a new tab) | |
| GHSA-f98w-7cxr-ff2h | Moderate | KaTeX's `\includegraphics` does not escape filename### 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 ru |
| GitHub (opens in a new tab) |
- GHSA-238p-pmpm-9mq7LowKaTeX: Existing prototype pollution can bypass trust restrictions
>= 0.11.0, < 0.18.2
### 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 applic
CVE: CVE-2026-103923
- GHSA-cg87-wmx4-v546ModerateKaTeX \htmlData does not validate attribute names
>= 0.12.0, < 0.16.21
### 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 scr
CVE: CVE-2025-23207
- GHSA-3wc5-fcw2-2329ModerateKaTeX missing normalization of the protocol in URLs allows bypassing forbidden protocols
>= 0.11.0, < 0.16.10
### 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 lower
CVE: CVE-2024-28246
- GHSA-64fm-8hw2-v72wModerateKaTeX's maxExpand bypassed by `\edef`
>= 0.12.0, < 0.16.10
### 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 th
CVE: CVE-2024-28243
- GHSA-cvr6-37gx-v8wcModerateKaTeX's maxExpand bypassed by Unicode sub/superscripts
>= 0.15.4, < 0.16.10
### 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 `₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸
CVE: CVE-2024-28244
- GHSA-f98w-7cxr-ff2hModerateKaTeX's `\includegraphics` does not escape filename
>= 0.11.0, < 0.16.10
### 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 ru
CVE: CVE-2024-28245