CVE-2025-29049: Mathlive Cross-Site Scripting Vulnerability
MODERATECVE-2025-29049 is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Mathlive libraries in the npm ecosystem. The issue involves mathlive's lack of escaping of html allows for xss. Remediation is available by upgrading affected packages to version 0.104.0.
CVE-2025-29049 at a Glance
Security Impact
CVSS: 6.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2025-29049
To remediate this vulnerability, upgrade all affected Mathlive dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install mathlive@0.104.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mathlive
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-29049, inspect your project dependencies using npm:
npm ls mathlive
Analyze the terminal output to locate any version of Mathlive in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.104.0), your application is affected.
Note: The npm ls mathlive command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Mathlive, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-29049 Affected Mathlive Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mathlive
|
npm |
< 0.104.0
|
0.104.0
|
References
Frequently Asked Questions
What is CVE-2025-29049?
Which Mathlive versions are affected?
What version fixes CVE-2025-29049?
Is mathlive affected?
What is the CVSS score of CVE-2025-29049?
What CWE is associated with CVE-2025-29049?
How can I check npm dependencies for CVE-2025-29049?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qwj6-q94f-8425",
"modified" : "2025-04-02T00:33:42Z",
"published" : "2025-01-21T21:17:52Z",
"aliases" : [ "CVE-2025-29049" ],
"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{><img/onerror=alert(1)\"src=}{}` or `\\htmlData{x=\" ><img/onerror=alert(1) src>}{}` 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mathlive"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.104.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.103.0"
}
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-116", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-21T21:17:52Z",
"nvd_published_at" : null
}
}