CVE-2026-103923: KaTeX Prototype Pollution Vulnerability Bypasses Trust Restrictions
Summary
CVE-2026-103923: KaTeX: Existing prototype pollution can bypass trust restrictions. Affects katex versions >= 0.11.0, < 0.18.2. Fixed in 0.18.2. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
KaTeX is a popular open-source library used for rendering mathematical expressions in web applications. It allows developers to display complex formulas using LaTeX syntax, making it a valuable tool for educational platforms, scientific applications, and any site that requires mathematical notation. However, KaTeX is susceptible to a prototype pollution vulnerability that can be exploited when combined with other vulnerable software, potentially leading to security risks.
Vulnerability Detail
The vulnerability arises from KaTeX's handling of renderer options, which can inherit properties from the prototype of the options object. If an attacker can manipulate the prototype or if the application has already been compromised, they can set inherited properties such as 'trust' to true. This can lead to unintended consequences, including cross-site scripting (XSS) attacks and the loading of malicious external resources. The vulnerability does not originate from KaTeX itself but from its interaction with other software that allows prototype pollution.
How To Fix
Latest published version: 0.19.0 as of 22 Oct 2026
npm install katex@0.19.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.18.2
This is the first release that contains the fix.
npm install katex@0.18.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
-
0: Address any prototype-pollution vulnerabilities in your application or its dependencies.
-
1: Delete potentially dangerous properties from Object.prototype before calling KaTeX:
-
3: Avoid allowing untrusted input to control the renderer options object or its prototype.
-
4: Sanitize KaTeX-generated HTML before inserting it into a document.
Conclusion
The KaTeX prototype pollution vulnerability (CVE-2026-103923) poses a significant risk to applications that use affected versions of the library. By upgrading to version 0.18.2 or later and implementing the recommended workarounds, developers can protect their applications from potential exploitation.
See every vulnerability recorded for katex →
FAQ
Prototype pollution is a security vulnerability that allows an attacker to manipulate the prototype of an object, potentially leading to unexpected behavior in applications.
If exploited, this vulnerability can lead to cross-site scripting (XSS) attacks, allowing attackers to execute malicious scripts in the context of your application.
Your application may be vulnerable if it uses an affected version of KaTeX and allows untrusted input to influence the renderer options object.
Implement the suggested workarounds to mitigate the risk until you can upgrade to the patched version.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application for this vulnerability using the Vulert playground without any signup.
References
Related vulnerabilities
Recent vulnerabilities recorded for katex.