Vulnerability · Published Apr 24, 2026 · Assigned by GitHub_M
CVE-2026-40897Math.js: Unsafe object property setter in mathjs
High 8.8
In plain English
A high-severity expression language injection in mathjs from josdejong. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 46% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | mathjs | 15.2.0 | GHSA-29qv-4j9f-fjw5 |
Affected products (as reported)
Weakness: CWE-915, CWE-917 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/josdejong/mathjs/security/advisories/GHSA-29qv-4j9f-fjw5 x_refsource_CONFIRM
- https://github.com/josdejong/mathjs/pull/3656 x_refsource_MISC
- https://github.com/josdejong/mathjs/commit/513ab2a0e01004af91b31aada68fae8a821326ad x_refsource_MISC
- https://access.redhat.com/security/cve/CVE-2026-40897 vdb-entry, x_refsource_REDHAT
- RHBZ#2461612 issue-tracking, x_refsource_REDHAT
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40897.json x_sadp-csaf-vex