{"id":"CVE-2025-23207","aliases":["GHSA-cg87-wmx4-v546"],"url":"https://o3.security/vulnerability/CVE-2025-23207","summary":"\\htmlData does not validate attribute names in KaTeX","details":"### Impact\nKaTeX users who render untrusted mathematical expressions with `renderToString` could encounter malicious input using `\\htmlData` that runs arbitrary JavaScript, or generate invalid HTML.\n\n### Patches\nUpgrade to KaTeX v0.16.21 to remove this vulnerability.\n\n### Workarounds\n- Avoid use of or turn off the `trust` option, or set it to forbid `\\htmlData` commands.\n- Forbid inputs containing the substring `\"\\\\htmlData\"`.\n- Sanitize HTML output from KaTeX.\n\n### Details\n`\\htmlData` did not validate its attribute name argument, allowing it to generate invalid or malicious HTML that runs scripts.\n\n### For more information\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)","published":"2025-01-17T21:25:05.746Z","modified":"2026-08-12T03:51:37.553791541Z","cvss":{"score":6.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"},"epss":{"score":0.00415,"percentile":0.35288,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"katex","fixedVersion":"0.16.21"}],"fix":{"url":"https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c","label":"KaTeX/KaTeX@ff28995"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/23xxx/CVE-2025-23207.json"},{"type":"ADVISORY","url":"https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-23207"},{"type":"FIX","url":"https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c"},{"type":"PACKAGE","url":"https://github.com/KaTeX/KaTeX"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:37.553791541Z"}}