CVE-2026-40897
What it is
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.
At a glance
- Exploitability
- Can be exploited over the network with a low-privilege account. High risk of data exposure, data tampering, service disruption.
- Exploit odds
- 0.6% chance of exploitation in the next 30 days (EPSS).
- Fix
- A patch, advisory or fixed version is referenced. Upgrade or apply it.
Timeline
- PublishedDisclosed publicly on CVE.org and NVD
- Last updatedMost recent change to the record
Why it ranks here
- Exploited in the wild: no, CISA does not list it.
- Exploit odds: 0.6% in the next 30 days (EPSS).
- Severity: 8.8 HIGH (CVSS).
- Fix: a patch or advisory is linked.
Details
- Published
- Last modified
- Exploit probability
- 0.6% · EPSS, next 30 days
- Weakness
- CWE-915
- Record status
- Modified
Affected
- Mathjs < 15.2.0
Attack profile CVSS 3.1 · 8.8
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Raw vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Is it in your code?
Hand this to your coding agent. It searches your project for the affected products and checks versions. Nothing leaves your machine.
Read https://cve-list.com/agent/cve/CVE-2026-40897.md and follow it. Check whether this project is affected by CVE-2026-40897. Read only. Don't change anything and don't upload my code. Tell me yes, no or not sure, with the file as proof.
Fix and advisories
- https://github.com/josdejong/mathjs/commit/513ab2a0e01004af91b31aada68fae8a821326ad
- https://github.com/josdejong/mathjs/pull/3656
- https://github.com/josdejong/mathjs/security/advisories/GHSA-29qv-4j9f-fjw5
References
- https://github.com/josdejong/mathjs/commit/513ab2a0e01004af91b31aada68fae8a821326ad
- https://github.com/josdejong/mathjs/pull/3656
- https://github.com/josdejong/mathjs/security/advisories/GHSA-29qv-4j9f-fjw5
- https://access.redhat.com/security/cve/CVE-2026-40897
- https://bugzilla.redhat.com/show_bug.cgi?id=2461612
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40897.json