Skip to main content

Math.js CVE-2026-41139

| EUVDEUVD-2026-28310 HIGH
Improperly Controlled Modification of Dynamically-Determined Object Attributes (CWE-915)
2026-05-07 GitHub_M GHSA-jvff-x2qm-6286
8.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to application
  2. Delivery
    Submit crafted Math.js expression with prototype pollution payload
  3. Exploit
    Trigger unsafe property access in parser
  4. Execution
    Modify Object.prototype or constructor
  5. Persist
    Application accesses polluted property
  6. Impact
    Execute injected JavaScript code

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V4 - API and Web Service Object attribute protection
Exploitation Conditions

Requires authenticated access (PR:L per CVSS vector) to functionality that passes user-controllable input to Math.js expression parser methods (evaluate(), parse(), or compile()). Network-accessible attack vector (AV:N) with low complexity (AC:L) means exploitation succeeds against default Math.js configurations without special environmental factors. Specifically vulnerable when application accepts arbitrary mathematical expressions from authenticated users - common in business intelligence dashboards, spreadsheet-like interfaces, formula builders, scientific computing APIs, or configuration systems using Math.js for dynamic calculations. No user interaction required (UI:N) beyond submitting the malicious expression. Not exploitable in deployments where Math.js only processes hardcoded or administrator-defined formulas, or where strict allowlisting prevents prototype-related keywords in input. Version range 13.1.0-15.1.x is required; versions before 13.1.0 or 15.2.0+ are not vulnerable.

Impact

High real-world risk despite requiring authentication (PR:L). CVSS 8.8 reflects network-accessible attack vector with low complexity and no user interaction required (AV:N/AC:L/UI:N), enabling straightforward exploitation once authenticated. The scope is unchanged (S:U) but all CIA impacts are high (C:H/I:H/A:H), meaning full system compromise within the application context. No EPSS or KEV data provided, but the vulnerability's publication via GitHub security advisory (GHSA-5v89-rwgr-qj6g) with detailed patch code significantly lowers exploitation barrier for skilled attackers. The attack requires only crafted mathematical expression input to a vulnerable Math.js parser instance - a common usage pattern in calculation engines, data processing pipelines, and user-facing formula evaluators. Patch availability in v15.2.0 is confirmed by tagged GitHub release and two commit hashes. Priority is HIGH for any application passing user-controlled strings to Math.js evaluate() or parse() functions, especially in multi-tenant or API contexts where authenticated users could escalate privileges or access other tenants' data. Lower priority for purely internal calculation uses with trusted inputs.

Exploit ScenarioDerived

An authenticated attacker with access to a web application's calculation feature submits a crafted mathematical expression like 'constructor.prototype.polluted = "hacked"' or uses bracket notation to access __proto__ properties through the Math.js parser. The vulnerable property access functions (isSafeProperty) incorrectly permit this manipulation, allowing prototype pollution of JavaScript objects throughout the application runtime. The attacker then leverages the polluted prototype to inject malicious properties that trigger code execution when accessed by subsequent application logic, achieving remote code execution in the Node.js context or browser environment with full application privileges. Public patch code in PR #3656 provides clear exploitation blueprint.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 07, 2026

Remote code execution in Math.js expression parser allows authenticated attackers to execute arbitrary JavaScript code in versions 13.1.0 through 15.1.x. The vulnerability stems from unsafe property access controls (CWE-915) that can be exploited via crafted mathematical expressions. Patched in version 15.2.0 with comprehensive property access validation (commit bcf0da4, PR #3656). No active exploitation confirmed by CISA KEV, but public patch code reveals exploitable attack surface involving prototype pollution or unsafe property traversal. CVSS 8.8 with network vector and low complexity indicates high real-world risk for applications exposing Math.js parsing to user input.

RemediationAI

Upgrade Math.js to version 15.2.0 or later immediately (https://github.com/josdejong/mathjs/releases/tag/v15.2.0). Apply via npm/yarn: 'npm install mathjs@15.2.0' or 'yarn upgrade mathjs@15.2.0'. The fix is implemented in commits bcf0da46f0b8577ec03c9ecd7bff8b5c2543a611 and 0aee2f61866e35ffa0aef915221cdf6b026ffdd4 (PR #3656 at https://github.com/josdejong/mathjs/pull/3656). If upgrade is not immediately feasible, implement strict input validation to reject expressions containing '__proto__', 'constructor', 'prototype', or bracket notation property access before passing to Math.js parser. Deploy this as a temporary workaround layer - note that blocklists are fragile and may be bypassed via encoding or parser quirks, so upgrade remains mandatory. For applications where Math.js is only used for trusted internal calculations (no user input), risk is lower but upgrade still recommended as defense-in-depth. Review application logs for anomalous mathematical expressions that may indicate exploitation attempts (e.g., expressions containing prototype chain keywords or unexpected property access patterns).

Affected VersionsENISA

mathjs 13.1.0, < 15.2.0

Affected Packages

npm mathjs fix: 15.2.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Math.js is a widely-used JavaScript mathematical expression parser and computation library for Node.js and browser environments (cpe:2.3:a:josdejong:mathjs). The vulnerability maps to CWE-915 (Improperly Controlled Modification of Dynamically-Determined Object Attributes), commonly known as prototype pollution or unsafe property access. The GitHub PR diff reveals the root cause: insufficient validation in property access functions (getSafeProperty, setSafeProperty, isSafeProperty in src/utils/customs.js) allowed attackers to access or modify dangerous properties like __proto__, constructor, or prototype on Objects and Arrays. The fix introduces strict separation between isSafeObjectProperty (blocks inheritance from Object.prototype) and isSafeArrayProperty (restricts to numeric indices and 'length'), plus explicit type checking to prevent non-array index manipulation. Additional hardening in src/utils/array.js validates array indices. This class of vulnerability is critical in expression parsers that evaluate user-controlled input, as it can bypass sandboxing to achieve arbitrary code execution through JavaScript's prototype chain.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Red Hat 8.8 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

Math.js versions 13.1.0 through 15.1.x contain a remote code execution vulnerability in the expression parser that allows authenticated attackers to execute arbitrary JavaScript code through crafted mathematical expressions. Organizations using affected versions in production environments face significant risk of application compromise and potential lateral movement if Math.js processes untrusted input from end users or integrated systems.

Business Impact: High
Compensating Controls

Until upgrade to version 15.2.0 is possible: (1) Restrict Math.js expression parsing to trusted internal sources only; disable or gate any user-facing mathematical expression features; (2) Implement strict input validation and whitelist allowable mathematical operations before parsing; (3) Run applications in restrictive sandbox environments with minimal JavaScript capabilities; (4) Monitor application logs for suspicious expression patterns or unexpected code execution; (5) Consider temporary network segmentation to limit lateral movement if compromise occurs. Apply vendor patch (Math.js 15.2.0) as primary remediation.

Threat Intelligence Overview

EPSS Score
0.1%
Top 81% exploitable
Threat Intel
1
1 source
Social Media
2
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy