Skip to main content

KaTeX CVE-2026-103923

| EUVDEUVD-2026-90979 LOW
Reliance on Untrusted Inputs in a Security Decision (CWE-807)
2026-10-01 GitHub_M GHSA-238p-pmpm-9mq7
2.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Leverage pre-existing prototype pollution
  2. Delivery
    Submit crafted \href math expression
  3. Exploit
    KaTeX reads inherited trust value
  4. Execution
    Unsanitized anchor with javascript: URI rendered
  5. Persist
    Victim clicks link
  6. Impact
    Script 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.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

KaTeX 0.11.0, < 0.18.2

Affected Packages

npm katex fix: 0.18.2

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

Vendor (GitHub_M) PRIMARY 2.1 LOW
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 01, 2026 - 18:17 EUVD
CVE Published
Oct 01, 2026 - 17:37 cve.org
LOW 2.1

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

EPSS Score
0.3%
Top 79% exploitable
Prevalence
High
KaTeX is a widely embedded math-rendering library across docs sites and apps
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy