CVE-2025-29049: MathLive HTML escaping vulnerability in \htmlData command

CVE-2025-29049 · Severity: low · CVSS 3.1 · Published 2025-01-21

MathLive is a JavaScript library that renders mathematical expressions using LaTeX. The library provides an \htmlData command that allows embedding HTML content without proper escaping, enabling attackers to inject malicious JavaScript code. Users who render untrusted mathematical expressions are at risk of arbitrary code execution.

Technologies: mathlive (npm). Vendors: npm.

Quick answers

Is CVE-2025-29049 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-29049 being exploited in the wild.
How severe is CVE-2025-29049?
Low severity, with a CVSS score of 3.1, published 21 January 2025.
Which products and versions are affected?
mathlive (npm) SEMVER:introduced=0,fixed=0.104.0.
Is there a fix for CVE-2025-29049?
Yes. mathlive (npm): upgrade to 0.104.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-29049 attacked?
It is attacked over the network.
Am I affected by CVE-2025-29049?
Check whether you run mathlive (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • mathlive (npm): upgrade to 0.104.0 or later
    npm install mathlive@0.104.0

Technical details

MathLive fails to escape HTML output when processing the \htmlData LaTeX command, resulting in a cross-site scripting (XSS) vulnerability (CWE-116, CWE-79). An attacker can craft malicious LaTeX input using \htmlData with embedded HTML/JavaScript payloads (e.g., \htmlData{><img/onerror=alert(1)"src=}{}) to execute arbitrary JavaScript in the context of a web application. The vulnerability requires the victim to render an untrusted mathematical expression, with no additional privileges required. The vulnerability affects all versions up to and including 0.103.0, and is patched in version 0.104.0.

Affected products

  • Arnog MathLive <=0.103.0

Identifiers

  • CVE-2025-29049
  • GHSA-qwj6-q94f-8425

Timeline

  • 2025-01-18: disclosed
  • 2025-01-21: patched: Fixed in version 0.104.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.