# CVE-2025-23207: \htmlData does not validate attribute names in KaTeX

- Severity: Medium 6.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 36% of CVEs (2026-12-01)
- Published: 2025-01-17T21:22:56.000Z
- Modified: 2026-06-17T08:52:38.510Z
- Also known as: GHSA-cg87-wmx4-v546
- Weaknesses: CWE-79, CWE-116
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- KaTeX KaTeX: >= 0.12.0, < 0.16.21; from 0.12.0 before 0.16.21
- katex (npm): from 0.12.0 before 0.16.21

## Every score

- GitHub_M: CVSS:3.1 6.3 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:3.1 6.3 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`
- NVD: CVSS:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N`

## References

- <https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546> (third-party-advisory, web)
- <https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-23207> (advisory)
- <https://github.com/KaTeX/KaTeX> (package)

## Sources

- CVE List: [CVE-2025-23207](https://www.cve.org/CVERecord?id=CVE-2025-23207), CVE Terms of Use, modified 2025-01-17
- GitHub Advisory Database: [GHSA-cg87-wmx4-v546](https://github.com/advisories/GHSA-cg87-wmx4-v546), CC-BY-4.0, modified 2025-01-21
- NVD: [CVE-2025-23207](https://nvd.nist.gov/vuln/detail/CVE-2025-23207), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-23207 · Whole record: https://cve.day/CVE-2025-23207.json · Rebuilt by cve.day 2026-11-25T22:58:53.418Z
