Josdejong mathjs
Math.js: Unsafe object property setter in mathjs
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 13.1.1, < 15.2.0
Fixed in 15.2.0
Mitigation
Upgrade mathjs to 15.2.0 or later.
References
Timeline
Days relative to CVE publicationFirst public PoC 12 days after publication; not in CISA KEV. First PoC: EQSTLab/CVE-2026-40897 (created 7 May 2026, found by us: backfilled).
PoC repositories
Found on GitHub.2 PoCs
PoCs 2
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| EQSTLab/CVE-2026-40897 | 7 May 2026 +12 d | 2 | PoC |
| yym8538/CVE-2026-40897 | 21 Aug 2026 +118 d | 1 | PoC |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
PoC characteristics
What to hunt for in your logs · from 2 PoC reposPOST /calculate
- Content-Type
application/json- Ports
- 3000
- Seen in
- 2 repos: EQSTLab/CVE-2026-40897, yym8538/CVE-2026-40897
- Evidence
- EQSTLab/CVE-2026-40897/server.js:103 yym8538/CVE-2026-40897/server.js:103
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/calculate(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [3000] (msg:"GG PoC-Monitor CVE-2026-40897 josdejong mathjs exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/calculate"; reference:url,poc.griffinguard.io/cve/CVE-2026-40897; classtype:web-application-attack; sid:9753944; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: josdejong mathjs exploit attempt (CVE-2026-40897)
id: gg-pocmon-cve-2026-40897-9753944
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-40897. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-40897
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/calculate'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.40897