Raw vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HSummary
CVE-2026-40897 is a high-severity Improperly Controlled Modification of Dynamically-Determined Object Attributes (CWE-915) vulnerability in Mathjs Mathjs. Its CVSS base score is 8.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked at the 43th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and AC-6 (Least Privilege) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
CVE-2026-40897 is a vulnerability in the Math.js library (mathjs), an extensive math library for JavaScript and Node.js. It affects versions from 13.1.1 to before 15.2.0 and stems from the expression parser, which allows execution of arbitrary JavaScript code. Applications are vulnerable if they permit users to evaluate arbitrary expressions using the mathjs parser. The issue is classified as CWE-915 (Improperly Controlled Modification of Dynamically-Determined Expression Evaluators) with a CVSS v3.1 base score of 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
An attacker requires low privileges, such as those of an authenticated user, to exploit this over the network with low complexity and no user interaction. By submitting a malicious expression to the parser, they can execute arbitrary JavaScript in the application's context, potentially leading to high impacts on confidentiality, integrity, and availability, such as data theft, modification, or denial of service.
The vulnerability is addressed in mathjs version 15.2.0. Mitigation involves updating to this version or later. Details are available in the GitHub security advisory (GHSA-29qv-4j9f-fjw5), pull request #3656, and fixing commit 513ab2a0e01004af91b31aada68fae8a821326ad.
OWASP Top 10 for Web (2025)
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-25571
Vulnerability Data
Math.js is an extensive math library for JavaScript and Node.js. From 13.1.1 to before 15.2.0, a vulnerability allowed executing arbitrary JavaScript via the expression parser of mathjs. You can be affected when you have an application where users can evaluate…
more
arbitrary expressions using the mathjs expression parser. This vulnerability is fixed in 15.2.0.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
V1.1.2V1.3.2V1.3.5V4.3.1
Mitigating Controls (NIST 800-53 r5) AI
Enforces authorizations so that only permitted attributes may be modified on an object.
Limits the set of modifiable attributes a subject is authorized to touch.
Validates incoming attribute names and values so that only explicitly allowed fields are accepted for update.
Security engineering principles include requirements for safe construction and sanitization of dynamic statements, structurally preventing expression-language injection at design time.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure SDLC practices directly require allow-listing of mutable object attributes and input validation to block mass-assignment flaws.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Secure coding standards explicitly forbid unsafe dynamic attribute assignment and require property allow-lists.
Security testing can detect mass-assignment flaws but does not itself prevent them at runtime.
Secure development lifecycle requires input validation and object-property whitelisting that directly mitigates mass-assignment risks.
Application security requirements include explicit rules for allowable object attributes and safe deserialization.
Secure architecture principles mandate strict control over dynamic object modification and attribute binding.
Information access restriction limits who can modify objects but does not address which attributes may be changed.