{"id":"CVE-2025-23207","published":"2025-01-17T21:25:05Z","modified":"2025-01-17T21:32:24Z","title":"\\htmlData does not validate attribute names in KaTeX","vendor":"KaTeX","product":"KaTeX","tier":"tail","description":{"text":"KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. KaTeX users who render untrusted mathematical expressions with `renderToString` could encounter malicious input using `\\htmlData` that runs arbitrary JavaScript, or generate invalid HTML. Users are advised to upgrade to KaTeX v0.16.21 to remove this vulnerability. Users unable to upgrade should avoid use of or turn off the `trust` option, or set it to forbid `\\htmlData` commands, forbid inputs containing the substring `\"\\\\htmlData\"` and sanitize HTML output from KaTeX.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00571,"percentile":0.41098,"provenance":"source"},"cwes":[{"id":"CWE-116","name":"Improper Encoding or Escaping of Output"}],"references":[{"url":"https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c","tags":["x_refsource_MISC"]}],"priority":{"score":12.6,"factors":[{"name":"EPSS percentile","points":8.22},{"name":"CVSS severity","points":4.41}]},"vendorSlug":"katex","affectedVersions":[{"vendor":"KaTeX","product":"KaTeX","versions":[">= 0.12.0, < 0.16.21"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-01-17T21:32:10.973799Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"katex","vulnerableRanges":[">=0.12.0, <0.16.21"],"patched":["0.16.21"],"from":["GHSA-cg87-wmx4-v546"],"provenance":"source"}],"summary":{"text":"The KaTeX JavaScript library for TeX math rendering on the web fails to validate attribute names processed by its \\htmlData command, in the KaTeX product itself. An attacker who can supply a mathematical expression that is rendered with renderToString can use \\htmlData to inject arbitrary JavaScript or produce invalid HTML, requiring network access and low-privileged authentication, with no user interaction needed and the flaw reachable only when the trust option is enabled.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:55:49Z"},"euvd":{"id":"EUVD-2025-0112","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-katex-cve-2024-28245","parents":[{"from":"CVE-2024-28245","to":"CVE-2025-23207","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/domTree.js"],"commits":["https://github.com/KaTeX/KaTeX/commit/c5897fcd1f73da9612a53e6b5544f1d776e17770","https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c"],"basis":"rarely changed file"}]}]}}