CVE-2017-1001002: Arbitrary Code Execution in mathjs

mathjs Updated 02 Oct 2025

Summary

18/12/2017
Yes i
Critical
9.8

CVE-2017-1001002: Arbitrary Code Execution in mathjs. Affects mathjs versions < 3.17.0. Fixed in 3.17.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The mathjs package is an open-source JavaScript library that provides a comprehensive set of mathematical functions and expressions. It is commonly used for mathematical computations and formula parsing in various applications. However, versions prior to 3.17.0 of math.js are vulnerable to arbitrary code execution.

Vulnerability Detail

The vulnerability in math.js before version 3.17.0 allows for arbitrary code execution in the JavaScript engine. By creating a typed function with JavaScript code in the name, an attacker can trigger arbitrary execution of code. This can lead to unauthorized access, data manipulation, or other malicious activities depending on the context in which math.js is used.

How To Fix

Latest published version: 15.2.0 as of 22 Oct 2026

npm install mathjs@15.2.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.17.0

This is the first release that contains the fix.

npm install mathjs@3.17.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, updating to the latest version of math.js is the recommended solution.

Conclusion

The vulnerability in math.js allows for arbitrary code execution, posing a significant security risk. To mitigate this vulnerability, it is crucial to update math.js to version 3.17.0 or later. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mathjs →

Share this vulnerability

FAQ

math.js is an open-source JavaScript library that provides mathematical functions and expression parsing capabilities.

The vulnerability allows for arbitrary code execution, which can lead to unauthorized access, data manipulation, or other malicious activities.

Updating math.js to version 3.17.0 or later will fix this vulnerability.

Versions prior to 3.17.0 of math.js are affected by this vulnerability.

There is no specific workaround mentioned for this vulnerability. Updating to the latest version is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for mathjs.

How To Fix

Latest published version: 15.2.0 as of 22 Oct 2026

npm install mathjs@15.2.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.17.0

This is the first release that contains the fix.

npm install mathjs@3.17.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback