Skip to content
Fencer Vulns
high 8.8

CVE-2026-40897 json

Math.js: Unsafe object property setter in mathjs

published 2026-04-16 6 mo ago modified 2026-10-26 13 d ago also EUVD-2026-25571 , GHSA-29qv-4j9f-fjw5

cvss
8.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 46%
public exploits
0
none known

Summary

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 arbitrary expressions using the mathjs expression parser. This vulnerability is fixed in 15.2.0.

Patch / fix

  • npm mathjs 15.2.0
  • mathjs math.js 15.2.0
  • mathjs mathjs 15.2.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2026-40897 updated cvss 8.8

mathjs: Math.js: Arbitrary code execution via expression parser

  • Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9 Red Hat Enterprise Linux 8 qt5-qtbase, qt5-qtbase-gui, qt5-qtbase-odbc, qt5-qtbase-mysql, qt5-qtbase-common, qt5-qtbase-examples, +1 more Red Hat Enterprise Linux 9 qt5-qtbase, qt5-qtbase-gui, qt5-qtbase-odbc, qt5-qtbase-mysql, qt5-qtbase-common, qt5-qtbase-examples, +1 more Red Hat Enterprise Linux 10 qt6-qtbase Red Hat OpenShift AI (RHOAI) rhoai/odh-dashboard-rhel9, rhoai/odh-mod-arch-maas-rhel9, rhoai/odh-mod-arch-gen-ai-rhel9, rhoai/odh-mod-arch-model-registry-rhel9 Red Hat OpenShift Container Platform 4 openshift4/ose-monitoring-plugin-rhel9
    +1 more products
    Red Hat Self-service automation portal 2 ansible-automation-platform/automation-portal
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
6 mo ago

Exploit prediction

0.55% chance of exploitation in the next 30 days, higher than 46% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CISA ADP 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
npm mathjs
>=13.1.1, <15.2.0
15.2.0

Affected products

  • josdejong mathjs
  • Red Hat Red Hat Developer Hub
  • Red Hat Red Hat Enterprise Linux 10
  • Red Hat Red Hat Enterprise Linux 8
  • Red Hat Red Hat Enterprise Linux 9
  • Red Hat Red Hat OpenShift AI (RHOAI)
  • Red Hat Red Hat OpenShift Container Platform 4
  • Red Hat Self-service automation portal 2

Classification

Weakness
  • CWE-915 Improperly Controlled Modification of Dynamically-Determined Object Attributes
  • CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.