CVE-2026-103923: KaTeX: Existing prototype pollution can bypass trust restrictions
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. From 0.11.0 until 0.18.2, KaTeX uses ordinary JavaScript property access for the renderer options object, the trust setting, default and processor setting metadata, and namespace lookup and group restoration, allowing inherited properties to be treated as explicitly supplied values. When Object.prototype is already polluted or an attacker controls the options object's prototype, attacker-controlled mathematical expressions can use an inherited trust value to enable trusted rendering and produce links capable of user-interaction cross-site scripting or loading attacker-selected external resources in a consuming application that inserts unsanitized KaTeX output into a page. KaTeX does not itself create the prototype pollution, and rendering an expression alone does not execute script. This issue is fixed in version 0.18.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
KaTeXto a version that resolves this vulnerability.Fixed in 0.18.2
Event History
Frequently Asked Questions
What conditions are required for exploitation?
Object.prototype must already be polluted, or the attacker must control the prototype of the KaTeX renderer options object. The attacker must also be able to supply mathematical expressions, and the consuming application must insert unsanitized KaTeX output into a page.
What is the practical impact of a successful bypass?
An inherited trust value can enable trusted rendering, allowing expressions to produce links that can lead to user-interaction cross-site scripting or cause the application to load attacker-selected external resources. Rendering an expression by itself does not execute script.
Are applications using default KaTeX behavior directly exposed?
The issue depends on inherited properties being treated as explicitly supplied values; KaTeX does not create the required prototype pollution itself. Applications are exposed when a polluted global prototype or attacker-controlled options-object prototype can influence rendering.
What should be done if upgrading cannot happen immediately?
Prevent and remediate prototype pollution in the application and ensure untrusted users cannot control the prototype of KaTeX options objects. Avoid inserting unsanitized KaTeX output into pages where attacker-controlled expressions are rendered.
Which versions require remediation?
KaTeX versions from 0.11.0 through 0.18.2 are identified as affected. The issue is fixed in version 0.18.2.