# CVE-2026-12866: silentmatt expr-eval code execution in toJSFunction API

Source: https://junglewise.ai/threats/cve-2026-12866-silentmatt-expr-eval-code-execution-in-tojsfunction-api  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-23. Updated: 2026-06-23  
License: CC BY 4.0 with a link back

CVE-2026-12866 · Severity: critical · CVSS 9.8 · Published 2026-06-23

The expr-eval library, a tool used to evaluate mathematical expressions in applications, is vulnerable to a flaw that allows attackers to run unauthorized code. By providing specially crafted input to the expression evaluator, an attacker can bypass security restrictions and execute arbitrary commands on the underlying server. This could lead to a complete system takeover, theft of sensitive data, or disruption of services.

Technologies: [Silentmatt Expr-Eval](https://junglewise.ai/threats/technologies/expr-eval). Vendors: [Maven](https://junglewise.ai/threats/vendors/maven), [Silentmatt](https://junglewise.ai/threats/vendors/silentmatt).

## Quick answers

**Is CVE-2026-12866 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-12866 being exploited in the wild.

**How severe is CVE-2026-12866?** Critical severity, with a CVSS score of 9.8, published 23 June 2026.

**Which products and versions are affected?** org.webjars.npm:expr-eval (Maven) <= 2.0.2, ECOSYSTEM:introduced=0,last_affected=2.0.2; Silentmatt Expr-Eval All versions.

**Is there a fix for CVE-2026-12866?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-12866 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-12866?** Check whether you run org.webjars.npm:expr-eval (Maven) or Silentmatt Expr-Eval at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The expr-eval package is vulnerable to Code Injection (CWE-94) via the toJSFunction() API. The root cause is the use of the 'new Function()' constructor to compile user-supplied expressions into native JavaScript. During this process, variable values are coerced via toString() and concatenated into the function body without sufficient sanitization or isolation. In Node.js environments, an attacker can provide an object with a custom toString() method that returns malicious code, allowing them to access Node globals like 'process' to perform file system operations or execute shell commands. As of the advisory date, no fixed version is available.

## Affected products

- silentmatt expr-eval All versions

## Identifiers

- CVE-2026-12866
- GHSA-q9v2-7m5w-4693

## Timeline

- 2026-01-20: disclosed: Vulnerability reported via GitHub issue
- 2026-06-22: advisory: Snyk published advisory
- 2026-06-23: disclosed: CVE published to NVD

## References

- [https://github.com/silentmatt/expr-eval/blob/master/src/expression.js%23L55](https://github.com/silentmatt/expr-eval/blob/master/src/expression.js%23L55)
- [https://github.com/silentmatt/expr-eval/issues/292](https://github.com/silentmatt/expr-eval/issues/292)
- [https://security.snyk.io/vuln/SNYK-JS-EXPREVAL-15054690](https://security.snyk.io/vuln/SNYK-JS-EXPREVAL-15054690)
