A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-41139

CVE-2026-41139: Math.js Expression Parser RCE Vulnerability

CVE-2026-41139 is a remote code execution vulnerability in Math.js expression parser affecting versions 13.1.0 to 15.2.0. Attackers can execute arbitrary JavaScript code. This article covers technical details, affected versions, and mitigation.

Published: May 7, 2026

CVE-2026-41139 Overview

CVE-2026-41139 is an arbitrary JavaScript execution vulnerability in Math.js, a widely used math library for JavaScript and Node.js. The flaw exists in the expression parser and affects versions from 13.1.0 up to (but not including) 15.2.0. Attackers who can submit crafted mathematical expressions to an application using mathjs can break out of the parser sandbox and execute arbitrary JavaScript in the host process. The issue is tracked under [CWE-915] and was patched in version 15.2.0.

Critical Impact

Successful exploitation grants attackers arbitrary JavaScript execution within the application context, leading to full compromise of confidentiality, integrity, and availability of the host process.

Affected Products

  • Math.js versions 13.1.0 through 15.1.x
  • Node.js applications embedding the mathjs expression parser
  • Browser applications exposing mathjs evaluation to untrusted input

Discovery Timeline

  • 2026-05-07 - CVE-2026-41139 published to NVD
  • 2026-05-07 - Last updated in NVD database
  • Patch released in Math.js v15.2.0
  • Tracked in GitHub Security Advisory GHSA-5v89-rwgr-qj6g

Technical Details for CVE-2026-41139

Vulnerability Analysis

Math.js exposes an expression parser that evaluates user-supplied formulas. The parser enforces a property allow-list to prevent access to dangerous JavaScript internals such as constructor, __proto__, and prototype methods. The vulnerability arises because the property safety checks were inconsistently applied across helper utilities, including src/utils/array.js and src/utils/map.js. Attackers can craft expressions that pass arguments of unexpected types, such as objects or non-array structures, into functions that previously assumed safe inputs. This allows attacker-controlled property access to reach unsafe JavaScript objects and execute arbitrary code.

Root Cause

The root cause is improperly controlled modification of dynamically determined object attributes [CWE-915]. Helper functions did not validate that index arguments were arrays before iterating them, and property accessors used getSafeProperty checks that did not cover all object property classes. The fix introduces stricter input type validation and a new isSafeObjectProperty helper that broadens the unsafe-property denylist used by map and object utilities.

Attack Vector

Exploitation requires the attacker to submit an evaluated expression to math.evaluate() or the equivalent parser entry point. Any application that accepts user-supplied formulas — for example, a calculator service, dashboard formula field, or scientific notebook — is exposed if it forwards untrusted strings to the parser. No special privileges beyond the ability to submit an expression are required, and no user interaction is needed once the input reaches the parser.

javascript
// Patch excerpt from src/utils/array.js — adds type validation on the
// index parameter to prevent attacker-supplied non-array objects from
// reaching unsafe property lookups.
export function get (array, index) {
  if (!Array.isArray(array)) { throw new Error('Array expected') }
  if (!Array.isArray(index)) {
    throw new Error('Array expected for index')
  }
  const size = arraySize(array)
  if (index.length !== size.length) {
    throw new DimensionError(index.length, size.length)
  }
  for (let x = 0; x < index.length; x++) {
    validateIndex(index[x], size[x])
  }
}
// Source: https://github.com/josdejong/mathjs/commit/0aee2f61866e35ffa0aef915221cdf6b026ffdd4
javascript
// Patch excerpt from src/utils/map.js — replaces isSafeProperty with the
// stricter isSafeObjectProperty helper to block access to additional
// dangerous object properties during expression evaluation.
import {
  getSafeProperty,
  isSafeObjectProperty,
  setSafeProperty
} from './customs.js'
import { isMap, isObject } from './is.js'
// Source: https://github.com/josdejong/mathjs/commit/0aee2f61866e35ffa0aef915221cdf6b026ffdd4

Detection Methods for CVE-2026-41139

Indicators of Compromise

  • Math.js expression strings referencing constructor, __proto__, prototype, or Function submitted to evaluation endpoints
  • Outbound network connections, child process spawns, or filesystem writes originating from Node.js workers that should only perform math evaluation
  • Unexpected eval, child_process, or require calls in process telemetry from services embedding mathjs

Detection Strategies

  • Inspect dependency manifests (package.json, package-lock.json, yarn.lock) for mathjs versions between 13.1.0 and 15.1.x
  • Log all expressions submitted to math.evaluate() and alert on suspicious tokens such as property accessors targeting JavaScript internals
  • Monitor Node.js runtime behavior for spawned shells or new module loads following expression parser invocation

Monitoring Recommendations

  • Forward Node.js application and process telemetry to a centralized analytics platform for behavioral correlation
  • Baseline expected mathjs workload behavior and alert on deviations such as new outbound destinations or file writes
  • Track Software Composition Analysis (SCA) findings to confirm patched versions are deployed across all environments

How to Mitigate CVE-2026-41139

Immediate Actions Required

  • Upgrade mathjs to version 15.2.0 or later in all production, staging, and developer environments
  • Audit applications that pass untrusted input to math.evaluate() and add server-side input filtering
  • Rebuild and redeploy container images and serverless bundles that embed vulnerable mathjs releases

Patch Information

The vulnerability is fixed in Math.js v15.2.0. The relevant fixes are introduced in commit 0aee2f6 and commit bcf0da4, with additional context in Pull Request #3656 and the GitHub Security Advisory GHSA-5v89-rwgr-qj6g.

Workarounds

  • Restrict the parser surface using math.import with { override: true } to remove unused functions reachable from expressions
  • Run expression evaluation in an isolated worker thread or sandboxed Node.js process with no filesystem or network access
  • Apply strict allow-lists on user-supplied formula syntax before forwarding strings to the parser
bash
# Upgrade mathjs to the patched release
npm install mathjs@^15.2.0

# Verify the installed version
npm ls mathjs

# Audit the project for residual vulnerable transitive dependencies
npm audit --production

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMathjs

  • SeverityHIGH

  • CVSS Score8.8

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-915
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Bug Fix

  • GitHub Pull Request #3656

  • GitHub Release v15.2.0

  • GitHub Security Advisory GHSA-5v89-rwgr-qj6g
  • Related CVEs
  • CVE-2026-40897: Math.js Expression Parser RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English