MathLive's Lack of Escaping of HTML allows for XSSGHSA-qwj6-q94f-8425
MEDIUMFix: arnog/mathlive@abc2605GHSA-qwj6-q94f-8425 is a medium-severity (CVSS 6.3) Cross-site Scripting (XSS) vulnerability in mathlive. A fix is available for mathlive — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-qwj6-q94f-8425.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
mathlivenpmDescription
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{><img/onerror=alert(1)"src=}{}or\htmlData{x=" ><img/onerror=alert(1) src>}{}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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | mathlive | all versions | 0.104.0npm install mathlive@0.104.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mathlive, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update mathlive to 0.104.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qwj6-q94f-8425 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-qwj6-q94f-8425 in your dependencies?
Find it across npm, including transitive dependencies.