CVE-2026-41139 Unsafe array index getter in mathjs
Attackers can execute arbitrary JavaScript code via the expression parser in the mathjs library, requiring an upgrade to the latest version.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-41139?
CVE-2026-41139 is a high-severity code injection vulnerability in josdejong mathjs, published on 7 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
Math.js is an extensive math library for JavaScript and Node.js. From version 13.1.0 to before version 15.2.0, arbitrary JavaScript can be executed via the expression parser of mathjs. This issue has been patched in version 15.2.0.
Which versions are affected by CVE-2026-41139?
2 open source packages ship an affected version, including mathjs. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mathjs npm | From 13.1.0 | 15.2.0 |
mathjs npm | From 13.1.0 | 15.2.0 |
Products include Mathjs Mathjs.
How do I fix CVE-2026-41139?
Upgrade mathjs to 15.2.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-41139 being exploited?
There is no known exploitation of CVE-2026-41139 in the wild and no public exploit code.
Other vulnerabilities in josdejong mathjs
Sources
Also known as GHSA-5v89-rwgr-qj6g, GHSA-jvff-x2qm-6286.