Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to application
-
DeliverySubmit crafted Math.js expression with prototype pollution payload
-
ExploitTrigger unsafe property access in parser
-
ExecutionModify Object.prototype or constructor
-
PersistApplication accesses polluted property
-
ImpactExecute 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
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
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond
EUVD-2026-28310
GHSA-jvff-x2qm-6286
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB