Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint accepting expr-eval formula
-
DeliverySubmit crafted expression abusing constructor access
-
ExploittoJSFunction() concatenates payload into source
-
Executionnew Function() compiles attacker JavaScript
-
PersistEvaluator invocation executes payload in-process
-
ImpactRCE 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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)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
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.
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
Lifecycle Timeline
1DescriptionCVE.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- 2,328 npm packages depend on expr-eval (283 direct, 2,049 indirect)
Ecosystem-wide dependent count for version 2.0.2.
Executive ViewAI
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
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.
LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutContr
Reachable assertion in Open5GS up to version 2.7.6 allows remote unauthenticated attackers to crash the Diameter CER han
A Command Injection issue in the payload build page in BYOB (Build Your Own Botnet) 2.0 allows attackers to execute arbi
Denial of service in Open5GS 2.7.6 and earlier allows network-adjacent attackers with low-privilege Diameter Gx peer acc
Denial of service in Open5GS HSS (Home Subscriber Server) versions 2.7.0 through 2.7.6 is triggered remotely by manipula
Remote command injection in Control Web Panel allows unauthenticated attackers to execute arbitrary OS commands as root
LINQPad before 5.52.01 Pro edition is vulnerable to Unsafe Deserialization in LINQPad.AutoRefManager::PopulateFromCache(
Remote code execution in dash-uploader (Python package for Plotly Dash) versions 0.1.0 through 0.7.0a2 allows unauthenti
Command injection in LiteLLM 1.18.10 lets attackers who can configure MCP (Model Context Protocol) servers supply arbitr
SQL injection in AzuraCast's backup restore flow (versions up to and including 0.23.7) lets an attacker achieve privileg
Arbitrary file read in Yu AI Code Mother v4.3 lets anonymous, remote attackers retrieve files outside the intended previ
Remote code execution in APScheduler (all versions through 3.10.x and 4.0.0a5) is achievable when applications deseriali
EUVD-2026-38415
GHSA-q9v2-7m5w-4693
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB