{"id":"GHSA-qwj6-q94f-8425","summary":"MathLive's Lack of Escaping of HTML allows for XSS","details":"### Summary\nDespite 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.\n\n### Details\nOverall in the code, other than in the `test` folder, no functions escaping HTML can be seen.\n\n### PoC\n1. Go to https://cortexjs.io/mathlive/demo/\n2. Paste either `\\htmlData{\u003e\u003cimg/onerror=alert(1)\"src=}{}` or `\\htmlData{x=\" \u003e\u003cimg/onerror=alert(1) src\u003e}{}` in the LaTeX textarea.\n\n### Impact\nMathLive users who render untrusted mathematical expressions could encounter malicious input using \\htmlData that runs arbitrary JavaScript, or generate invalid HTML.","aliases":["CVE-2025-29049"],"modified":"2026-07-08T07:27:38.159109127Z","published":"2025-01-21T21:17:52Z","database_specific":{"github_reviewed_at":"2025-01-21T21:17:52Z","nvd_published_at":null,"cwe_ids":["CWE-116","CWE-79"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/arnog/mathlive/security/advisories/GHSA-qwj6-q94f-8425"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-29049"},{"type":"WEB","url":"https://github.com/arnog/mathlive/commit/abc26056fd5e29a99edfa96a0bbe855ea2a8b678"},{"type":"PACKAGE","url":"https://github.com/arnog/mathlive"}],"affected":[{"package":{"name":"mathlive","ecosystem":"npm","purl":"pkg:npm/mathlive"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.104.0"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 0.103.0","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/01/GHSA-qwj6-q94f-8425/GHSA-qwj6-q94f-8425.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"}]}