CVE-2025-29049: MathLive's Lack of Escaping of HTML allows for XSS
Summary Despite normal text rendering as LaTeX expressions, preventing XSS, the library also provides users with commands which may modify HTML, such as the \htmlData command, and the lack of escaping leads to XSS. Details Overall in the code, other than in the test folder, no functions escaping HTML can be seen. PoC 1. Go to https://cortexjs.io/mathlive/demo/ 2. Paste either \htmlData{ }{} in the LaTeX textarea.
Published Jan 21, 2025 · Updated Apr 2, 2025
Affected packages
mathlive
- Ecosystem
- npm
- Affected
- <= 0.103.0
- Fixed in
- 0.104.0
- Check
npm ls mathlive
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Despite normal text rendering as LaTeX expressions, preventing XSS, the library also provides users with commands which may modify HTML, such as the \htmlData command, and the lack of escaping leads to XSS.
Details
Overall in the code, other than in the test folder, no functions escaping HTML can be seen.
PoC
- Go to https://cortexjs.io/mathlive/demo/
- Paste either
\htmlData{>}{}in the LaTeX textarea.
Impact
MathLive users who render untrusted mathematical expressions could encounter malicious input using \htmlData that runs arbitrary JavaScript, or generate invalid HTML.
Credited to nsysean, arnog.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
