CVE-2024-28246
KaTeX missing normalization of the protocol in URLs allows bypassing forbidden protocols
Reported by github_m · Published March 25, 2024
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.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| KaTeX | KaTeX | >= 0.11.0, < 0.16.10 |
| KaTeX | KaTeX | 0.11.0 |
| npm | katex | 0.11.0 |
Timeline
- Mar 25, 2024 CVE Published
- Mar 26, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (7 in total, the first dated here)
- Jan 14, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-28246
vulnetix vdb fixes CVE-2024-28246
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-28246/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/KaTeX/KaTeX/security/advisories/GHSA-3wc5-fcw2-2329 x_refsource_CONFIRM
- https://github.com/KaTeX/KaTeX/commit/fc5af64183a3ceb9be9d1c23a275999a728593de x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2024-28246 advisory
- https://github.com/advisories/GHSA-3wc5-fcw2-2329 advisory
- https://github.com/KaTeX/KaTeX url