CVE-2017-1001003: mathjs arbitrary code execution via unicode property bypass

CVE-2017-1001003 · Severity: low · CVSS 3 · Published 2017-12-18

math.js is a popular JavaScript library for mathematical operations and expressions. The vulnerability allowed attackers to bypass property access restrictions by using unicode character variants to reference forbidden properties like "constructor," potentially enabling arbitrary code execution in applications using vulnerable versions of the library.

Technologies: mathjs (npm). Vendors: npm.

Quick answers

Is CVE-2017-1001003 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2017-1001003 being exploited in the wild.
How severe is CVE-2017-1001003?
Low severity, with a CVSS score of 3, published 18 December 2017.
Which products and versions are affected?
mathjs (npm) SEMVER:introduced=0,fixed=3.17.0.
Is there a fix for CVE-2017-1001003?
Yes. mathjs (npm): upgrade to 3.17.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2017-1001003 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2017-1001003?
Check whether you run mathjs (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

  • mathjs (npm): upgrade to 3.17.0 or later
    npm install mathjs@3.17.0

Technical details

The vulnerability is a property access control bypass (CWE-88) in math.js versions before 3.17.0. Attackers could replace forbidden properties such as the constructor by using unicode lookalike characters when creating objects, bypassing the library's security checks. The attack is network-reachable and requires no authentication or user interaction if the application parses untrusted mathematical expressions via math.js. No known public exploits existed at the time of disclosure, though the vulnerability could potentially lead to arbitrary code execution. The fix was released in version 3.17.0 on 2017-11-18.

Affected products

  • Jos de Jong mathjs before 3.17.0

Identifiers

  • CVE-2017-1001003
  • GHSA-pv8x-p9hq-j328

Timeline

  • 2017-12-18: disclosed
  • 2017-11-18: patched: Fix released in version 3.17.0

References

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