\htmlData does not validate attribute names in KaTeX
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| KaTeX | KaTeX | 0.12.0 to before 0.16.21 | 0.16.21 | Patch available | CNA |
| — | katex (npm) | 0.12.0 to before 0.16.21 | 0.16.21 | Patch available | GHSA-cg87-wmx4-v546 |
- KaTeX VendorKaTeX Affected 0.12.0 to before 0.16.21 Fixed in 0.16.21 Patch available CNA
- katex (npm) Vendor— Affected 0.12.0 to before 0.16.21 Fixed in 0.16.21 Patch available GHSA-cg87-wmx4-v546
Remediation
- Fix · CNA KaTeX (KaTeX) Fixed in 0.16.21
- Fix · GHSA-cg87-wmx4-v546 katex (npm) Fixed in 0.16.21 Advisory →
Red Hat 1 advisory
- RHSA-2025:2753 Released 2025-03-13 · Red Hat rating ModerateRed Hat OpenShift Dev Spaces 3.19.0 release
- Red Hat OpenShift Dev Spaces 3 devspaces-tech-preview/idea-rhel9, devspaces-tech-preview/jetbrains-ide-rhel9, devspaces/code-rhel9 +10
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat OpenShift Dev Spaces 3 | Fixed | RHSA-2025:2753 |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-23207
- 2026-10-03 Alias added: GHSA-cg87-wmx4-v546
References
More Katex vulnerabilities
- TI-2024-18803 KaTeX's maxExpand bypassed by Unicode sub/superscripts CVSS 3.1MEDIUM 6.5
- TI-2024-18802 KaTeX's maxExpand bypassed by \edef CVSS 3.1MEDIUM 6.5
- TI-2024-18804 KaTeX's \includegraphics does not escape filename CVSS 3.1MEDIUM 6.3
- TI-2024-18805 KaTeX is missing normalization of the protocol in URLs allows bypassing forbidden protocols CVSS 3.1MEDIUM 5.5
Sources
- CVE-2025-23207 · CVE Program
- CVE-2025-23207 · NVD
- FIRST EPSS
- GHSA-cg87-wmx4-v546 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-23207 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences