Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLeverage pre-existing prototype pollution
-
DeliverySubmit crafted \href math expression
-
ExploitKaTeX reads inherited trust value
-
ExecutionUnsanitized anchor with javascript: URI rendered
-
PersistVictim clicks link
-
ImpactScript executes in victim context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Trusted input validation
|
| Exploitation Conditions | Exploitation is only possible when the surrounding application running KaTeX 0.11.0-0.18.2 already has a SEPARATE prototype-pollution primitive (so Object.prototype.trust, .default, or .processor can be set), OR the attacker can control the prototype of the options object passed to KaTeX; KaTeX itself does not introduce the pollution. The consuming application must also insert unsanitized KaTeX HTML output directly into the page. Even then, code execution requires the victim to actively click the resulting attacker-controlled link (javascript: URI or external resource) - rendering the expression alone does not execute script. These compounding prerequisites (external pollution source + unsanitized insertion + user click) substantially limit real-world exploitability below what a network XSS label would suggest. |
| Impact | This is a genuinely low-priority issue despite being an XSS-class flaw, and the signals are consistent rather than conflicting. The CVSS 4.0 base score is only 2.1, and the vector (AV:N/AC:L/AT:P/PR:N/UI:A) encodes the key limiters: AT:P reflects a mandatory precondition (Object.prototype must already be polluted by some OTHER component, since KaTeX does not create the pollution itself), and UI:A requires the victim to actively interact (click an attacker-crafted link). Impact is confined to the subsequent/consuming system (SC:L/SI:L) with no impact on KaTeX itself (VC:N/VI:N/VA:N), correctly capturing that this is a dependency-chain weakness (CWE-807, reliance on untrusted inputs in a security decision) rather than a direct code-execution bug. No EPSS score was provided, there is no CISA KEV listing, and no public exploit was supplied - only vendor fix code and regression tests. The practical risk is therefore contingent: it only materializes in an application that (a) already suffers a separate prototype-pollution primitive and (b) inserts unsanitized KaTeX output into the DOM. Treat as a defense-in-depth patch, not an urgent emergency. |
| Exploit ScenarioDerived | In an application already affected by a separate prototype-pollution bug, an attacker sets Object.prototype.trust=true, then submits a math expression such as \href{javascript:alert(1)}{x}; KaTeX reads the inherited trust value, treats the link as trusted, and emits an anchor tag. When the victim clicks the rendered link, the javascript: URI executes in their session. No public exploit code was supplied - only the vendor's regression tests demonstrate the mechanism. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 01, 2026
Prototype-pollution-assisted cross-site scripting in the KaTeX math-rendering JavaScript library (versions 0.11.0 through 0.18.2) lets attacker-controlled expressions end up in trusted-rendering mode when an inherited trust property is picked up from a polluted prototype, producing clickable javascript: links or attacker-chosen external resources in any consuming page that inserts unsanitized KaTeX output. This is not a standalone remote exploit: KaTeX does not create the prototype pollution itself, so a separate pollution primitive (or attacker control over the options object's prototype) must already exist in the host application, rendering an expression alone never executes script, and script execution requires the victim to actively click a crafted link. There is no confirmed active exploitation (not in CISA KEV) and no public exploit code identified at time of analysis, and the CVSS 4.0 base score is only 2.1 (our independent 3.1 assessment is AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N), reflecting the compounding prerequisites rather than a broadly reachable XSS bug.
RemediationAI
Primary fix: upgrade KaTeX to 0.18.2 or later (Vendor-released patch: 0.18.2) - see the advisory GHSA-238p-pmpm-9mq7 and the release at https://github.com/KaTeX/KaTeX/releases/tag/v0.18.2; the upstream hardening is in PR #4260 / commit 0adf7e77db6915d991803b29699f82b1ccf8d4f4. Because upgrading KaTeX alone does not remove the pollution primitive that this bug depends on, pair it with remediation of the actual prototype-pollution source in the host application (audit recursive merge/deep-extend/clone utilities and any code that assigns attacker-supplied keys onto shared objects), accepting that this requires code changes in the consumer rather than a configuration toggle. If an immediate upgrade is impossible, explicitly set trust: false via an own property on every Settings/render options object rather than relying on defaults, and pass options objects created with Object.create(null) or frozen literals so no prototype chain is consulted - the trade-off is that this must be done at every call site and is easy to miss. Independently of KaTeX, sanitize rendered output before DOM insertion (for example with DOMPurify configured to strip javascript: URI schemes and disallow a/link exec vectors) or render KaTeX output into a sandboxed context; note that sanitizing can break legitimate \href links, so allow-list the URI schemes you actually need. Blocking or stripping javascript:/data: URI schemes at the CSP level (script-src without unsafe-inline, plus a strict base-uri and form-action) provides defence-in-depth against the click-triggered payload, though it will not stop exfiltration to an attacker-controlled external resource unless connect-src/img-src/default-src are also tightened.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause class is CWE-807, Reliance on Untrusted Inputs in a Security Decision: KaTeX resolved renderer settings, the security-relevant trust flag, schema default and processor metadata, and namespace lookup/group-restoration state through ordinary JavaScript property access (e.g. options[prop], schema.default, schema.processor, this.current[name]), which walks the prototype chain. If Object.prototype has already been polluted - or if an attacker controls the prototype of the options object passed into new Settings(...) - those inherited properties are treated as if the caller explicitly supplied them. In practice the dangerous one is an inherited trust: true, because it flips KaTeX into trusted rendering mode, which permits \href/\url output such as javascript:alert(1) or links to attacker-selected external resources. The upstream fix (PR #4260, commit 0adf7e77db6915d991803b29699f82b1ccf8d4f4, shipped in v0.18.2) hardens src/Settings.ts and src/Namespace.ts by replacing bare property access with Object.prototype.hasOwnProperty.call(...) guards - returning undefined for namespace lookups that are not own properties and refusing to honour inherited default/processor/trust values - and adds regression tests under a new Settings prototype pollution suite in test/katex-spec.ts that verify a polluted Object.prototype.trust no longer causes \href{javascript:alert(1)}{x} to emit an <a href= tag. Note that the library still does not sanitize its generated HTML, so the consuming application remains responsible for safe insertion.
Know when Katex gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
AC:H because it requires a pre-existing external prototype-pollution condition; UI:R since the victim must click the link; S:C and C:L/I:L as impact lands in the separate consuming application.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
KaTeX is a JavaScript library for TeX math rendering on the web. Rated medium severity (CVSS 6.5), this vulnerability is
KaTeX is a JavaScript library for TeX math rendering on the web. Rated medium severity (CVSS 6.5), this vulnerability is
KaTeX is a JavaScript library for TeX math rendering on the web. Rated medium severity (CVSS 6.1), this vulnerability is
KaTeX is a JavaScript library for TeX math rendering on the web. Rated medium severity (CVSS 5.4), this vulnerability is
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. Rated medium severity (CVSS 6.3), thi
EUVD-2026-90979
GHSA-238p-pmpm-9mq7
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB