2026-06-23 5:0CVE-2026-12866snyk
PUBLISHED5.2CWE-94

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.

Problem type

Affected products

expr-eval

< * - AFFECTED

References

GitHub Security Advisories

GHSA-q9v2-7m5w-4693

All versions of the package expr-eval are vulnerable to Code Execution via the toJSFunction() API...

https://github.com/advisories/GHSA-q9v2-7m5w-4693

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.

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-12866
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-12866",
    "assignerOrgId": "bae035ff-b466-4ff4-94d0-fc9efd9e1730",
    "assignerShortName": "snyk",
    "dateUpdated": "2026-06-23T05:00:00.763Z",
    "dateReserved": "2026-06-22T08:22:34.991Z",
    "datePublished": "2026-06-23T05:00:00.763Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "bae035ff-b466-4ff4-94d0-fc9efd9e1730",
        "shortName": "snyk",
        "dateUpdated": "2026-06-23T05:00:00.763Z"
      },
      "descriptions": [
        {
          "lang": "en",
          "value": "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."
        }
      ],
      "affected": [
        {
          "vendor": "n/a",
          "product": "expr-eval",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "*"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "Code Execution",
              "cweId": "CWE-94"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://security.snyk.io/vuln/SNYK-JS-EXPREVAL-15054690"
        },
        {
          "url": "https://github.com/silentmatt/expr-eval/blob/master/src/expression.js%23L55"
        },
        {
          "url": "https://github.com/silentmatt/expr-eval/issues/292"
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "attackVector": "NETWORK",
            "attackComplexity": "LOW",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "availabilityImpact": "HIGH",
            "baseScore": 9.8,
            "baseSeverity": "CRITICAL",
            "exploitCodeMaturity": "NOT_DEFINED"
          }
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Dinh Twan Doan"
        }
      ]
    }
  }
}