Vulnerabilities in pkg:npm/katex

PACKAGE
Advisory Identifier: GHSA-238p-pmpm-9mq7
Advisory Summary

CVE-2026-103923 is a LOW existing prototype pollution can bypass vulnerability (CWE-807: Reliance on Untrusted Inputs in a Security Decision) affecting KaTeX libraries in the npm ecosystem. The issue involves existing prototype pollution can bypass trust restrictions. Remediation is available by upgrading affected packages to version 0.18.2.

6 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/katex

6 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/katex. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-238p-pmpm-9mq7 CVE-2026-103923 LOW KaTeX: Existing prototype pollution can bypass trust restrictions
GHSA-64fm-8hw2-v72w CVE-2024-28243 MODERATE KaTeX's maxExpand bypassed by `\edef`
GHSA-cg87-wmx4-v546 CVE-2025-23207 MODERATE KaTeX \htmlData does not validate attribute names
GHSA-3wc5-fcw2-2329 CVE-2024-28246 MODERATE KaTeX missing normalization of the protocol in URLs allows bypassing forbidden protocols
GHSA-f98w-7cxr-ff2h CVE-2024-28245 MODERATE KaTeX's `\includegraphics` does not escape filename
GHSA-cvr6-37gx-v8wc CVE-2024-28244 MODERATE KaTeX's maxExpand bypassed by Unicode sub/superscripts

CVE-2026-103923 at a Glance

CVE Identifier CVE-2026-103923
GHSA Identifier GHSA-238p-pmpm-9mq7
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-807: Reliance on Untrusted Inputs in a Security Decision
Affected Product KaTeX
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-103923

To remediate this vulnerability, upgrade all affected KaTeX dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

katex fixed: 0.18.2
npm install katex@0.18.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls katex

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-103923, inspect your project dependencies using npm:

npm ls katex

Analyze the terminal output to locate any version of KaTeX in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.2), your application is affected.

Note: The npm ls katex command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-807: Reliance on Untrusted Inputs in a Security Decision, where the product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism. In KaTeX, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact KaTeX can act as a read-side prototype pollution gadget in applications where `Object.prototype` has already been polluted, or where an attacker can influence the prototype of the renderer options object. (KaTeX does not enable said prototype pollution. This advisory applies when combining KaTeX with other vulnerable software that allows for prototype pollution.) Affected versions may treat inherited properties from `Object.prototype` as renderer options, internal setting metadata, or namespace entries. In particular, an inherited `trust` value will be treated as though the application explicitly enabled trusted rendering, rather than using the documented default of `false`. With attacker-controlled mathematical expressions, this can produce links capable of user-interaction cross-site scripting or load attacker-selected external resources. Exploitation requires the consuming application to insert KaTeX output into a web page without a separate sanitizer. (KaTeX does not execute scripts merely by rendering an expression.) Other inherited settings can alter rendering behavior or resource limits. Inherited setting metadata can affect how defaults and supplied options are processed, while inherited namespace properties can be mistaken for defined macros or other internal values. ### Patches Upgrade to KaTeX v0.18.2 to remove this vulnerability. ### Workarounds - Address any prototype-pollution vulnerability in the application or its dependencies. - `delete Object.prototype.trust`, `delete Object.prototype.default`, and `delete Object.prototype.processor` before calling KaTeX - Do not allow untrusted input to control the renderer options object or its prototype. - Sanitize KaTeX-generated HTML before inserting it into a document. ### Details KaTeX previously used ordinary JavaScript property access in the following contexts: - Renderer settings could be inherited from the prototype of the options object. - Internal `default` and `processor` setting metadata could be inherited from `Object.prototype`. - Namespace lookup could treat inherited properties as built-in definitions. - Namespace group restoration could preserve an inherited property as though it had been an explicitly defined value. The fix adds own-property checks to each of these paths. Inherited properties are no longer accepted as renderer settings, setting metadata, namespace definitions, or values to be restored after a group ends. ### For more information If you have any questions or comments about this advisory: - Open an issue or security advisory in the [KaTeX repository](https://github.com/KaTeX/KaTeX/) - Email us at [katex-security@mit.edu](mailto:katex-security@mit.edu)

CVE-2026-103923 Affected KaTeX Versions

1 component(s)
Fixed Versions:
0.18.2
Product / Package Ecosystem Affected Versions Fixed Version
katex
npm
≥ 0.11.0
< 0.18.2
0.18.2

References

Frequently Asked Questions

What is CVE-2026-103923?
CVE-2026-103923 is a security vulnerability in KaTeX involving Existing prototype pollution can bypass trust restrictions under CWE-807: Reliance on Untrusted Inputs in a Security Decision.
Which KaTeX versions are affected?
Affected versions include releases prior to 0.18.2 across affected packages: katex.
What version fixes CVE-2026-103923?
Upgrading to 0.18.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is katex affected?
Yes, katex is affected in releases prior to 0.18.2. Upgrade your dependency to 0.18.2 or later.
What CWE is associated with CVE-2026-103923?
CVE-2026-103923 is classified under CWE-807: Reliance on Untrusted Inputs in a Security Decision (The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.).
How can I check npm dependencies for CVE-2026-103923?
Run the dependency tree command: 'npm ls katex'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-238p-pmpm-9mq7",
  "modified" : "2026-10-05T23:41:05Z",
  "published" : "2026-10-05T23:41:05Z",
  "aliases" : [ "CVE-2026-103923" ],
  "summary" : "KaTeX: Existing prototype pollution can bypass trust restrictions",
  "details" : "### Impact\n\nKaTeX can act as a read-side prototype pollution gadget in applications where `Object.prototype` has already been polluted, or where an attacker can influence the prototype of the renderer options object. (KaTeX does not enable said prototype pollution. This advisory applies when combining KaTeX with other vulnerable software that allows for prototype pollution.)\n\nAffected versions may treat inherited properties from `Object.prototype` as renderer options, internal setting metadata, or namespace entries. In particular, an inherited `trust` value will be treated as though the application explicitly enabled trusted rendering, rather than using the documented default of `false`.\n\nWith attacker-controlled mathematical expressions, this can produce links capable of user-interaction cross-site scripting or load attacker-selected external resources. Exploitation requires the consuming application to insert KaTeX output into a web page without a separate sanitizer. (KaTeX does not execute scripts merely by rendering an expression.)\n\nOther inherited settings can alter rendering behavior or resource limits. Inherited setting metadata can affect how defaults and supplied options are processed, while inherited namespace properties can be mistaken for defined macros or other internal values.\n\n### Patches\n\nUpgrade to KaTeX v0.18.2 to remove this vulnerability.\n\n### Workarounds\n\n- Address any prototype-pollution vulnerability in the application or its dependencies.\n- `delete Object.prototype.trust`, `delete Object.prototype.default`, and `delete Object.prototype.processor` before calling KaTeX\n- Do not allow untrusted input to control the renderer options object or its prototype.\n- Sanitize KaTeX-generated HTML before inserting it into a document.\n\n### Details\n\nKaTeX previously used ordinary JavaScript property access in the following contexts:\n\n- Renderer settings could be inherited from the prototype of the options object.\n- Internal `default` and `processor` setting metadata could be inherited from `Object.prototype`.\n- Namespace lookup could treat inherited properties as built-in definitions.\n- Namespace group restoration could preserve an inherited property as though it had been an explicitly defined value.\n\nThe fix adds own-property checks to each of these paths. Inherited properties are no longer accepted as renderer settings, setting metadata, namespace definitions, or values to be restored after a group ends.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue or security advisory in the [KaTeX repository](https://github.com/KaTeX/KaTeX/)\n- Email us at [katex-security@mit.edu](mailto:katex-security@mit.edu)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "katex"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.11.0"
      }, {
        "fixed" : "0.18.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/KaTeX/KaTeX/security/advisories/GHSA-238p-pmpm-9mq7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-103923"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KaTeX/KaTeX/pull/4260"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KaTeX/KaTeX/commit/0adf7e77db6915d991803b29699f82b1ccf8d4f4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/KaTeX/KaTeX"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KaTeX/KaTeX/releases/tag/v0.18.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-807" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T23:41:05Z",
    "nvd_published_at" : "2026-10-01T18:17:13Z"
  }
}