Skip to main content

expr-eval EUVDEUVD-2026-38415

| CVE-2026-12866 CRITICAL
Code Injection (CWE-94)
2026-06-23 snyk GHSA-q9v2-7m5w-4693
Critical
Disputed · 9.2 Vendor: snyk
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint accepting expr-eval formula
  2. Delivery
    Submit crafted expression abusing constructor access
  3. Exploit
    toJSFunction() concatenates payload into source
  4. Execution
    new Function() compiles attacker JavaScript
  5. Persist
    Evaluator invocation executes payload in-process
  6. Impact
    RCE as the Node.js service account

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The vulnerable application must call the toJSFunction() API of expr-eval (not merely parse() or evaluate()) on an expression string that is influenced by an untrusted source such as an HTTP body, query parameter, message-queue payload, or saved user document. No authentication to expr-eval itself is required (PR:N), and no user interaction is needed once the expression reaches the API, but the CVSS 4.0 AT:P bit reflects the real-world prerequisite that the host application both exposes a path to toJSFunction() and accepts attacker-controlled expression text - applications that hard-code formulas or use only evaluate() with a scope object are not exploitable through this flaw.

Impact

The CVSS 4.0 vector AV:N/AC:L/AT:P/PR:N/UI:N with VC/VI/VA:H reflects a network-reachable, unauthenticated, low-complexity RCE whose only gating factor is the AT:P attack-requirement bit - namely, the consuming application must actually feed user input into toJSFunction(). EPSS and CISA KEV data are not provided in the input, and no public exploit is identified at time of analysis, but for any deployment that does expose toJSFunction() to untrusted callers the practical risk is severe because the exploit primitive (new Function on attacker text) is trivial and well understood. The biggest source of uncertainty is exposure rather than exploitability: many expr-eval users call only parse().evaluate(), which is comparatively safer, so headline severity should be weighed against whether the specific integration touches toJSFunction().

Exploit ScenarioDerived

An analyst-facing dashboard lets users define custom KPI formulas like '2*revenue+cost' which the backend compiles via expr-eval's toJSFunction() for speed. An attacker submits a formula such as 'constructor.constructor("return process.mainModule.require(\'child_process\').execSync(\'id\')")()' (or an equivalent that survives the tokenizer), and on the next evaluation the Node.js process executes the embedded shell command with the service account's privileges, yielding immediate RCE without authentication beyond whatever guards the formula-submission endpoint.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 23, 2026

Arbitrary JavaScript code execution in the expr-eval npm package affects all released versions when applications pass user-controlled expressions to the toJSFunction() API, which compiles them via new Function() and executes them in the host process context. Snyk discloses no public exploit identified at time of analysis, but the trivial attack pattern (sandbox escape via crafted math expressions) and CVSS 4.0 score of 9.2 make this a high-priority issue for any Node.js or browser application that exposes expr-eval to untrusted input.

RemediationAI

No vendor-released patch identified at time of analysis - the linked GitHub issue (#292) and the Snyk advisory do not cite a fixed version, so consumers should treat this as unpatched and act at the application layer. The most reliable compensating control is to stop calling toJSFunction() entirely and use Expression.evaluate() with a constrained variable scope, accepting the performance trade-off of interpreted rather than compiled evaluation. If toJSFunction() must remain, restrict its inputs to expressions authored by trusted operators (never end users), enforce a strict allowlist of identifiers and operators before parsing, and run the evaluator inside an isolated context such as vm2's successor isolated-vm or a separate Worker with no access to require, process, or globalThis; note that isolated-vm adds deployment complexity and Workers still share Node primitives unless explicitly stripped. Consider migrating to maintained alternatives such as mathjs (with its evaluate() in a scoped object) or filtrex, both of which avoid new Function() on user input.

Affected VersionsENISA

expr-eval 0 <*

Affected Packages

maven expr-eval no fix
maven org.webjars.npm:expr-eval no fix
npm expr-eval no fix
npm org.webjars.npm:expr-eval no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in maven, npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

expr-eval is a JavaScript expression parser/evaluator originally written by silentmatt, commonly embedded in Node.js services, dashboards, and rules engines to let users supply mathematical or logical formulas. The vulnerable toJSFunction() helper takes the parsed AST and concatenates it into a JavaScript source string that is then handed to the built-in Function constructor, which is functionally equivalent to eval(). This is a textbook CWE-94 (Improper Control of Generation of Code) flaw: the library's tokenizer was designed to restrict syntax to expression-language operators, but because the final compilation step reaches the full JavaScript runtime, any payload that survives the tokenizer (or abuses operator/identifier handling in expression.js around line 55) escapes the intended sandbox and runs with the privileges of the host process.

Know when N A gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Low–Critical)
Vendor (snyk) PRIMARY 9.2 CRITICAL
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
vuln.today AI 9.8 CRITICAL

Network-reachable API with no auth or interaction once the app exposes toJSFunction() to user input; full RCE yields high C/I/A within the same process scope.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 4.2 LOW

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorVendor: snyk

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Jun 23, 2026 - 05:22 NVD
9.8 (CRITICAL) 9.2 (CRITICAL)

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 2,328 npm packages depend on expr-eval (283 direct, 2,049 indirect)

Ecosystem-wide dependent count for version 2.0.2.

Executive ViewAI

Why It Matters

The expr-eval npm package (all released versions) contains a critical remote code execution vulnerability (CVE-2026-12866, CVSS 9.2) that allows arbitrary JavaScript execution in application processes when user-controlled expressions are passed to the toJSFunction() API. Any organization using expr-eval for expression evaluation faces complete compromise of affected services and access to data those services control. Immediate remediation is required given severity, absence of a vendor patch, and the trivial nature of the attack vector.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Remove expr-eval from all production applications immediately where operationally feasible; (2) If removal is infeasible, completely remove toJSFunction() API access and replace with safe property-lookup-only evaluation; (3) Implement strict input allowlisting and validation of all expressions before any evaluation; (4) Network-isolate affected services to segments with zero access to sensitive databases or systems; (5) Deploy real-time monitoring to alert on JavaScript Function constructor and eval pattern execution; (6) Restrict file system and system call privileges on containers or processes running affected applications to absolute minimum.

Threat Intelligence Overview

EPSS Score
0.5%
Top 64% exploitable
Prevalence
Medium
moderately popular npm expression parser, common in rules engines and dashboards
Threat Intel
1
1 sources
Social Media
3
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.5%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in N A

View all
CVE-2024-51092 CRITICAL POC
9.1 May 08

LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutContr

CVE-2025-15684 MEDIUM POC
5.5 Aug 12

Reachable assertion in Open5GS up to version 2.7.6 allows remote unauthenticated attackers to crash the Diameter CER han

CVE-2024-45257 HIGH POC
7.3 May 08

A Command Injection issue in the payload build page in BYOB (Build Your Own Botnet) 2.0 allows attackers to execute arbi

CVE-2025-15687 LOW POC
2.1 Aug 12

Denial of service in Open5GS 2.7.6 and earlier allows network-adjacent attackers with low-privilege Diameter Gx peer acc

CVE-2025-15686 LOW POC
2.1 Aug 12

Denial of service in Open5GS HSS (Home Subscriber Server) versions 2.7.0 through 2.7.6 is triggered remotely by manipula

CVE-2025-67888 HIGH POC
7.3 May 08

Remote command injection in Control Web Panel allows unauthenticated attackers to execute arbitrary OS commands as root

CVE-2024-53326 HIGH POC
7.3 May 08

LINQPad before 5.52.01 Pro edition is vulnerable to Unsafe Deserialization in LINQPad.AutoRefManager::PopulateFromCache(

CVE-2026-38360 CRITICAL POC
9.8 May 08

Remote code execution in dash-uploader (Python package for Plotly Dash) versions 0.1.0 through 0.7.0a2 allows unauthenti

CVE-2026-30623 CRITICAL POC
9.8 Jul 15

Command injection in LiteLLM 1.18.10 lets attackers who can configure MCP (Model Context Protocol) servers supply arbitr

CVE-2026-67917 CRITICAL POC
9.8 Aug 17

SQL injection in AzuraCast's backup restore flow (versions up to and including 0.23.7) lets an attacker achieve privileg

CVE-2026-75337 CRITICAL POC
9.8 Aug 27

Arbitrary file read in Yu AI Code Mother v4.3 lets anonymous, remote attackers retrieve files outside the intended previ

CVE-2026-31072 CRITICAL POC
9.8 May 19

Remote code execution in APScheduler (all versions through 3.10.x and 4.0.0a5) is achievable when applications deseriali

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy