Impact
KaTeX versions 0.11.0 through 0.18.1 used direct JavaScript property access for renderer options and trust configuration. This allowed an attacker to pollute Object.prototype or supply an options object with an overridden prototype, so inherited properties were treated as explicitly set. The attacker could thus set the "trust" flag to true and inject mathematical expressions containing links or external resources, leading to user‑interaction cross‑site scripting or unintended script loading within any application that inserts raw KaTeX output into a page. The vulnerability does not trigger script execution by rendering the expression alone; it requires the consuming application to incorporate the untrusted output into the DOM without sanitization.
Affected Systems
The vulnerability affects the KaTeX library from version 0.11.0 up to but excluding 0.18.2. All instances of KaTeX delivered under the KaTeX repository that have not applied the 0.18.2 release are potentially impacted. Vendors and ecosystems that embed KaTeX in web pages and rely on the trust setting to disable unsafe rendering are within scope.
Risk and Exploitability
The CVSS score of 2.1 indicates a low severity rating, and the EPSS score is less than 1 %, suggesting a very low likelihood of exploitation. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires that the environment already has Object.prototype polluted or that the attacker can control the prototype of the options object supplied to the renderer. Additionally, the consuming application must render the KaTeX output into the DOM without sanitization for the XSS to succeed. While the risk of accidental misuse is relatively low, any exposed KaTeX instance that accepts custom options from untrusted sources or runs within an application that blindly injects KaTeX output presents a realistic attack surface.
OpenCVE Enrichment
Github GHSA