CVE-2026-41139 Unsafe array index getter in mathjs

High 8.8 Published Updated

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.

Weakness: CWE-94, CWE-915

Which versions are affected by CVE-2026-41139?

2 open source packages ship an affected version, including mathjs. It affects 1 product.

PackageAffectedFixed in
mathjs npmFrom 13.1.015.2.0
mathjs npmFrom 13.1.015.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.

Sources

Also known as GHSA-5v89-rwgr-qj6g, GHSA-jvff-x2qm-6286.

Is CVE-2026-41139 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free