CVE-2017-1001002 Arbitrary Code Execution in mathjs

Critical 9.8 Published Updated

Attackers can execute arbitrary code by crafting malicious function names in the math.js library, requiring developers to upgrade to a patched version.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2017-1001002?

CVE-2017-1001002 is a critical code injection vulnerability in math.js, published on 27 Nov 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

math.js before 3.17.0 had an arbitrary code execution in the JavaScript engine. Creating a typed function with JavaScript code in the name could result arbitrary execution.

Weakness: CWE-94

Which versions are affected by CVE-2017-1001002?

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

PackageAffectedFixed in
mathjs npmAll versions3.17.0
mathjs npmAll versions3.17.0

Products include Mathjs Math.js.

How do I fix CVE-2017-1001002?

Upgrade mathjs to 3.17.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2017-1001002 being exploited?

There is no known exploitation of CVE-2017-1001002 in the wild and no public exploit code.

Sources

Also known as GHSA-vx5c-87qx-cv6c.

Is CVE-2017-1001002 in your software?

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

Check your SBOMs for free