CVE-2026-41139
8.8josdejong · mathjs
A vulnerability in mathjs allows authenticated attackers to execute arbitrary JavaScript via the expression parser.
Executive summary
An improper control of dynamically-determined object attributes vulnerability in mathjs affects versions 13.1.0 through 15.1.x, allowing low-privileged attackers to achieve arbitrary code execution.
Vulnerability
This flaw involves CWE-915, allowing the improper modification of dynamically-determined object attributes within the expression parser. Low-privileged attackers can leverage this mechanism to execute arbitrary JavaScript code with network attack vector complexity.
Business impact
A successful exploit grants an attacker the ability to execute arbitrary code within the context of the running Node.js or JavaScript environment. This can lead to complete system compromise, data exfiltration, or service disruption. The CVSS score of 8.8 reflects the high severity of total confidentiality, integrity, and availability impact.
Remediation
Immediate Action: Update the mathjs package to version 15.2.0 or later to resolve the vulnerability.
Proactive Monitoring: Monitor application logs for unusual expression evaluations or unauthorized access attempts targeting Node.js execution routines.
Compensating Controls: Implement strict input sanitization and expression validation rules at the application layer to restrict parser capabilities if immediate patching is not possible.
Exploitation status
Public Exploit Available: No
Analyst recommendation
Organizations utilizing the mathjs library must treat this high-severity advisory with urgency. Administrators should immediately upgrade to version 15.2.0 to eliminate the risk of arbitrary JavaScript execution and secure the underlying application environment.
Sources
- https://github.com/josdejong/mathjs/security/advisories/GHSA-5v89-rwgr-qj6g
- https://github.com/josdejong/mathjs/pull/3656
- https://github.com/josdejong/mathjs/commit/0aee2f61866e35ffa0aef915221cdf6b026ffdd4
- https://github.com/josdejong/mathjs/commit/bcf0da46f0b8577ec03c9ecd7bff8b5c2543a611
- https://github.com/josdejong/mathjs/releases/tag/v15.2.0