CVE-2024-28246
KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.5
KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols
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.
- Record
CVE-2024-28246- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-184, CWE-697
- Updated
- 2026-11-02
EUVDEUVD-2024-0807
5.5
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.
- Record
EUVD-2024-0807- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-3wc5-fcw2-2329
5.5
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
trustfunction. - Manually lowercase
context.protocolviacontext.protocol.toLowerCase()before attempting to check for certain protocols. - Avoid use of or turn off the
trustoption.
Details
KaTeX did not normalize the protocol entry of the context object provided to a user-specified trust-function, so it could be a mix of lowercase and/or uppercase letters.
It is generally better to allow-list by protocol, in which case this would normally not be an issue. But in some cases, you might want to block-list, and the KaTeX documentation even provides such an example:
Allow all commands but forbid specific protocol:
trust: (context) => context.protocol !== 'file'
Currently KaTeX internally sees file: and File: URLs as different protocols, so context.protocol can be file or File, so the above check does not suffice. A simple workaround would be:
trust: (context) => context.protocol.toLowerCase() !== 'file'
Most URL parsers normalize the scheme to lowercase. For example, RFC3986 says:
Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.
- Record
GHSA-3wc5-fcw2-2329- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-184
- Updated
- 2026-11-02
NVD
5.5
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.
- Record
CVE-2024-28246- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Weakness
- CWE-184, CWE-697
- Updated
- 2026-11-02
OSV
5.5
KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols
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.
- Record
CVE-2024-28246- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-184, CWE-697
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-28246
5.4
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.
- Record
DEBIAN-CVE-2024-28246- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-3wc5-fcw2-2329
5.5
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
trustfunction. - Manually lowercase
context.protocolviacontext.protocol.toLowerCase()before attempting to check for certain protocols. - Avoid use of or turn off the
trustoption.
Details
KaTeX did not normalize the protocol entry of the context object provided to a user-specified trust-function, so it could be a mix of lowercase and/or uppercase letters.
It is generally better to allow-list by protocol, in which case this would normally not be an issue. But in some cases, you might want to block-list, and the KaTeX documentation even provides such an example:
Allow all commands but forbid specific protocol:
trust: (context) => context.protocol !== 'file'
Currently KaTeX internally sees file: and File: URLs as different protocols, so context.protocol can be file or File, so the above check does not suffice. A simple workaround would be:
trust: (context) => context.protocol.toLowerCase() !== 'file'
Most URL parsers normalize the scheme to lowercase. For example, RFC3986 says:
Although schemes are case-insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency.
- Record
GHSA-3wc5-fcw2-2329- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - Weakness
- CWE-184
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-28246
5.5
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.
- Record
UBUNTU-CVE-2024-28246- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L - CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
OSVCLSA-2026-1790624011 No score
TuxCare security update for katex (3 CVEs)
TuxCare rebuilt katex to address 3 CVEs. Fixed in 0.12.0-tuxcare.1.
- Record
CLSA-2026-1790624011- Updated
- 2026-11-02
OSVUSN-7572-1 No score
node-katex vulnerabilities
Juho Forsén discovered that KaTeX did not correctly handle certain inputs, which could lead to an infinite loop. If a user or application were tricked into opening a specially crafted file, an attacker could possibly use this issue to cause a denial of service. This issue only affected Ubuntu 22.04 LTS. (CVE-2024-28243)
Tobias S. Fink discovered that KaTeX did not correctly block certain URL protocols. If a user or system were tricked into opening a specially crafted file, an attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 22.04 LTS. (CVE-2024-28246)
It was discovered that KaTeX did not correctly handle certain inputs. If a user or system were tricked into opening a specially crafted file, an attacker could possibly use this issue to execute arbitrary code. This issue only affected Ubuntu 22.04 LTS. (CVE-2024-28245)
Sean Ng discovered that KaTeX did not correctly handle certain inputs. If a user or system were tricked into opening a specially crafted file, an attacker could possibly use this issue to execute arbitrary code. (CVE-2025-23207)
- Record
USN-7572-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
katexnpm |
0.11.0 up to 0.16.10 | 0.16.10 |
katexTuxCare:npm From an advisory covering 3 CVEs |
0.12.0-tuxcare.0 up to 0.12.0-tuxcare.1, plus listed versions 0.12.0 |
0.12.0-tuxcare.1 |
node-katexDebian:12 |
All versions, plus listed versions 0.16.10+~cs6.1.0-10.16.10+~cs6.1.0-100.16.10+~cs6.1.0-20.16.10+~cs6.1.0-30.16.10+~cs6.1.0-4 Show 6 moreShow less0.16.10+~cs6.1.0-50.16.10+~cs6.1.0-60.16.10+~cs6.1.0-70.16.10+~cs6.1.0-80.16.10+~cs6.1.0-90.16.4+~cs6.1.0-1 |
None known |
node-katexDebian:13 |
before 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 |
node-katexDebian:14 |
before 0.16.10+~cs6.1.0-1 | 0.16.10+~cs6.1.0-1 |
node-katexUbuntu:Pro:22.04:LTS |
before 0.13.11+~cs6.0.0-2ubuntu0.1~esm1, plus listed versions 0.10.2+dfsg-80.10.2+dfsg-90.10.2+dfsg-100.13.11+~cs6.0.0-2 |
0.13.11+~cs6.0.0-2ubuntu0.1~esm1 |
node-katexUbuntu:Pro:22.04:LTS From an advisory covering 4 CVEs |
before 0.13.11+~cs6.0.0-2ubuntu0.1~esm1, plus listed versions 0.10.2+dfsg-80.10.2+dfsg-90.10.2+dfsg-100.13.11+~cs6.0.0-2 |
0.13.11+~cs6.0.0-2ubuntu0.1~esm1 |
node-katexUbuntu:Pro:24.04:LTS From an advisory covering 4 CVEs |
before 0.16.10+~cs6.1.0-2ubuntu0.24.04.1~esm1, plus listed versions 0.16.4+~cs6.1.0-10.16.10+~cs6.1.0-2 |
0.16.10+~cs6.1.0-2ubuntu0.24.04.1~esm1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-28246 is a medium vulnerability (CVSS 5.5) in Katex, published March 25, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.41%, the 35th percentile. Fixed in katex 0.16.10.
References
github.com/KaTeX/KaTeX/security/advisories/GHSA-3wc5-fcw2-2329
github.com/KaTeX/KaTeX/commit/fc5af64183a3ceb9be9d1c23a275999a728593de
nvd.nist.gov/vuln/detail/CVE-2024-28246
github.com/advisories/GHSA-3wc5-fcw2-2329
github.com/CVEProject/cvelistV5/tree/main/cves/2024/28xxx/CVE-2024-28246.json
security-tracker.debian.org/tracker/CVE-2024-28246