CVE-2026-41139: Mathjs Mathjs Allows Improperly Controlled Modification Vulnerability

HIGH
Advisory Identifier: GHSA-jvff-x2qm-6286
CVSS 8.8
CWE-915
Published
Advisory Summary

CVE-2026-41139 is a HIGH (CVSS 8.8) mathjs allows improperly controlled modification vulnerability (CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes) affecting Mathjs libraries in the npm ecosystem. The issue involves mathjs allows improperly controlled modification of dynamically-determined object attributes. Remediation is available by upgrading affected packages to version 15.2.0.

CVE-2026-41139 at a Glance

CVE Identifier CVE-2026-41139
GHSA Identifier GHSA-jvff-x2qm-6286
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
Affected Product Mathjs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-41139

To remediate this vulnerability, upgrade all affected Mathjs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mathjs fixed: 15.2.0
npm install mathjs@15.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mathjs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-41139, inspect your project dependencies using npm:

npm ls mathjs

Analyze the terminal output to locate any version of Mathjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 15.2.0), your application is affected.

Note: The npm ls mathjs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes, where the product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified. In Mathjs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact This security 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. ### Patches The issue was introduced in mathjs `v13.1.0`, and patched in mathjs `v15.2.0`. ### Workarounds There is no workaround without upgrading to `v15.2.0`. ### References You can find out more via the commit fixing this issue: https://github.com/josdejong/mathjs/commit/24d5ee7e25e85d49619b09122f055db4139bc057 (part of PR https://github.com/josdejong/mathjs/pull/3656).

CVE-2026-41139 Affected Mathjs Versions

1 component(s)
Fixed Versions:
15.2.0
Product / Package Ecosystem Affected Versions Fixed Version
mathjs
npm
≥ 13.1.0
< 15.2.0
15.2.0

References

Frequently Asked Questions

What is CVE-2026-41139?
CVE-2026-41139 is a security vulnerability in Mathjs involving mathjs Allows Improperly Controlled Modification of Dynamically-Determined Object Attributes under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes.
Which Mathjs versions are affected?
Affected versions include releases prior to 15.2.0 across affected packages: mathjs.
What version fixes CVE-2026-41139?
Upgrading to 15.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mathjs affected?
Yes, mathjs is affected in releases prior to 15.2.0. Upgrade your dependency to 15.2.0 or later.
What is the CVSS score of CVE-2026-41139?
CVE-2026-41139 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-41139?
CVE-2026-41139 is classified under CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes (The product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.).
How can I check npm dependencies for CVE-2026-41139?
Run the dependency tree command: 'npm ls mathjs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jvff-x2qm-6286",
  "modified" : "2026-05-08T19:55:44Z",
  "published" : "2026-04-10T22:10:49Z",
  "aliases" : [ "CVE-2026-41139" ],
  "summary" : "mathjs Allows Improperly Controlled Modification of Dynamically-Determined Object Attributes",
  "details" : "### Impact\nThis security 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.\n\n### Patches\nThe issue was introduced in mathjs `v13.1.0`, and patched in mathjs `v15.2.0`.\n\n### Workarounds\nThere is no workaround without upgrading to `v15.2.0`.\n\n### References\nYou can find out more via the commit fixing this issue: https://github.com/josdejong/mathjs/commit/24d5ee7e25e85d49619b09122f055db4139bc057 (part of PR https://github.com/josdejong/mathjs/pull/3656).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mathjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.1.0"
      }, {
        "fixed" : "15.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/security/advisories/GHSA-5v89-rwgr-qj6g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/security/advisories/GHSA-jvff-x2qm-6286"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/pull/3656"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/commit/0aee2f61866e35ffa0aef915221cdf6b026ffdd4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/commit/bcf0da46f0b8577ec03c9ecd7bff8b5c2543a611"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/josdejong/mathjs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/josdejong/mathjs/releases/tag/v15.2.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-915" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T22:10:49Z",
    "nvd_published_at" : "2026-05-07T06:16:04Z"
  }
}