CVE-2026-12866: Expr eval Expr-eval Vulnerable To Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-q9v2-7m5w-4693
CVSS 9.8
CWE-94
Published
Advisory Summary

CVE-2026-12866 is a CRITICAL (CVSS 9.8) expr-eval vulnerable to code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Expr eval libraries in the npm ecosystem. The issue involves expr-eval vulnerable to code execution. Remediation is available in the latest vendor maintenance releases.

CVE-2026-12866 at a Glance

CVE Identifier CVE-2026-12866
GHSA Identifier GHSA-q9v2-7m5w-4693
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Expr eval
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
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-12866

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

expr-eval fixed: Latest secure release
npm install expr-eval@Latest secure release
org.webjars.npm:expr-eval fixed: Latest secure release
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>expr-eval</artifactId>
    <version>Latest secure release</version>
</dependency>
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 expr-eval

How to Check if You Are Affected

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

npm ls expr-eval

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

Note: The npm ls expr-eval 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Expr eval, 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

All versions of the package expr-eval are vulnerable to Code Execution via the toJSFunction() API. An attacker can execute arbitrary JavaScript by supplying crafted expressions that are compiled into native code using new Function(). Because user-controlled expressions are transformed directly into executable JavaScript, attackers can escape the intended expression sandbox and run arbitrary code within the application's context.

CVE-2026-12866 Affected Expr eval Versions

2 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
expr-eval
npm
≤ 2.0.2
org.webjars.npm:expr-eval
Maven
≤ 2.0.2

References

Frequently Asked Questions

What is CVE-2026-12866?
CVE-2026-12866 is a security vulnerability in Expr eval involving expr-eval vulnerable to Code Execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Expr eval versions are affected?
Affected versions include releases prior to current release patches across affected packages: expr-eval, org.webjars.npm:expr-eval.
What version fixes CVE-2026-12866?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is expr-eval affected?
Yes, expr-eval is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-12866?
CVE-2026-12866 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-12866?
CVE-2026-12866 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-12866?
Run the dependency tree command: 'npm ls expr-eval'. 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-q9v2-7m5w-4693",
  "modified" : "2026-09-22T14:40:53Z",
  "published" : "2026-06-23T06:30:41Z",
  "aliases" : [ "CVE-2026-12866" ],
  "summary" : "expr-eval vulnerable to Code Execution",
  "details" : "All versions of the package expr-eval are vulnerable to Code Execution via the toJSFunction() API. An attacker can execute arbitrary JavaScript by supplying crafted expressions that are compiled into native code using new Function(). Because user-controlled expressions are transformed directly into executable JavaScript, attackers can escape the intended expression sandbox and run arbitrary code within the application's context.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "expr-eval"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.webjars.npm:expr-eval"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12866"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/silentmatt/expr-eval/issues/292"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/silentmatt/expr-eval"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/silentmatt/expr-eval/blob/master/src/expression.js#L55"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-17662018"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-EXPREVAL-15054690"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-22T14:40:52Z",
    "nvd_published_at" : "2026-06-23T05:17:03Z"
  }
}