# CVE-2024-28246: KaTeX protocol normalization bypass in trust option

Source: https://junglewise.ai/threats/cve-2024-28246-katex-protocol-normalization-bypass-in-trust-option  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-03-25. Updated: 2026-05-14  
License: CC BY 4.0 with a link back

CVE-2024-28246 · Severity: low · CVSS 3.1 · Published 2024-03-25

KaTeX is a popular JavaScript library used to display mathematical formulas on websites. A security flaw in how it handles web links allows attackers to bypass security filters by using uppercase letters in link protocols (like using 'Javascript:' instead of 'javascript:'). This could allow an attacker to inject malicious scripts into a page, potentially leading to unauthorized actions or data theft when a user clicks a link.

Technologies: [katex (npm)](https://junglewise.ai/threats/technologies/katex). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-28246 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-28246 being exploited in the wild.

**How severe is CVE-2024-28246?** Low severity, with a CVSS score of 3.1, published 25 March 2024.

**Which products and versions are affected?** katex (npm) SEMVER:introduced=0.11.0,fixed=0.16.10.

**Is there a fix for CVE-2024-28246?** Yes. katex (npm): upgrade to 0.16.10 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-28246 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-28246?** Check whether you run katex (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- katex (npm): upgrade to 0.16.10 or later

  ```sh
  npm install katex@0.16.10
  ```


## Technical details

KaTeX contains a vulnerability where the 'trust' option, used to filter or block-list specific URL protocols, fails to normalize the protocol string to lowercase before evaluation. An attacker can bypass security filters that check for forbidden protocols (such as 'javascript:') by providing mixed-case or uppercase versions (e.g., 'JAVASCRIPT:'). This occurs because the internal context object provided to the user-specified trust function treats 'file:' and 'File:' as distinct. If a developer uses a block-list approach for security, an attacker can successfully inject malicious links. The issue is resolved in version 0.16.10 by forcing protocols to lowercase during the filtering process.

## Affected products

- KaTeX katex >= 0.11.0, < 0.16.10

## Identifiers

- CVE-2024-28246
- GHSA-3wc5-fcw2-2329

## Timeline

- 2024-03-24: patched: Fix committed to repository
- 2024-03-25: advisory: GitHub Security Advisory published

## References

- [https://github.com/KaTeX/KaTeX/security/advisories/GHSA-3wc5-fcw2-2329](https://github.com/KaTeX/KaTeX/security/advisories/GHSA-3wc5-fcw2-2329)
- [https://github.com/KaTeX/KaTeX/commit/fc5af64183a3ceb9be9d1c23a275999a728593de](https://github.com/KaTeX/KaTeX/commit/fc5af64183a3ceb9be9d1c23a275999a728593de)
- [https://github.com/KaTeX/KaTeX](https://github.com/KaTeX/KaTeX)

## Related threats

- [KaTeX prototype pollution in renderer settings](https://junglewise.ai/threats/cve-2026-103923-katex-is-a-fast-easy-to-use-javascript-library-for-tex-math)
- [KaTeX htmlData attribute name validation bypass](https://junglewise.ai/threats/cve-2025-23207-katex-htmldata-attribute-name-validation-bypass)
- [KaTeX includegraphics improper output encoding in filename](https://junglewise.ai/threats/cve-2024-28245-katex-includegraphics-improper-output-encoding-in-filename)
- [KaTeX maxExpand bypass via Unicode sub/superscripts](https://junglewise.ai/threats/cve-2024-28244-katex-maxexpand-bypass-via-unicode-sub-superscripts)
- [KaTeX maxExpand bypass via \edef token expansion](https://junglewise.ai/threats/cve-2024-28243-katex-maxexpand-bypass-via-edef-token-expansion)
