CVE-2026-103923

KaTeX: Existing prototype pollution can bypass trust restrictions

Published Oct 1, 2026 CVSS 4.0 · 2.1 Low EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade KaTeX to version 0.18.2 or later, the release that removes prototype‑pollution‑sensitive property access.
  • Audit and cleanse the runtime environment to ensure Object.prototype has not been polluted prior to rendering.
  • When passing options to KaTeX, avoid exposing mutable prototype chains or user‑controlled prototypes; verify that the options object is a plain object without unexpected inherited properties.
  • Sanitize any KaTeX output before inserting it into the DOM, or disable the trust rendering option unless the content source is strictly controlled.

Generated by OpenCVE AI on October 2, 2026 at 14:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-238p-pmpm-9mq7 KaTeX: Existing prototype pollution can bypass trust restrictions
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-79
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Katex
Katex katex
Vendors & Products Katex
Katex katex
Type Values Removed Values Added
Description 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.
Title KaTeX: Existing prototype pollution can bypass trust restrictions
Weaknesses CWE-807
References
Metrics cvssV4_0

{'score': 2.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

  • CWE-807

    Reliance on Untrusted Inputs in a Security Decision

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 6, 2026, 1:59 AM
Reserved
Oct 1, 2026, 2:20 PM
Status
Awaiting Analysis
Published
Oct 1, 2026, 6:17 PM
Modified
Oct 6, 2026, 2:17 AM
Severity
Moderate
Public date
Oct 1, 2026, 5:37 PM