Vulnerabilities in pkg:npm/expr-eval-fork
PACKAGECVE-2025-12735 is a HIGH expr-eval does not restrict functions vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Expr eval libraries in the npm ecosystem. The issue involves expr-eval does not restrict functions passed to the evaluate function. Remediation is available by upgrading affected packages to version 3.0.1.
pkg:npm/expr-eval-fork
Vulnerability advisories affecting package pkg:npm/expr-eval-fork. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-jc85-fpwf-qm7x | CVE-2025-12735 | HIGH | expr-eval does not restrict functions passed to the evaluate function |
| GHSA-8gw3-rxh4-v6jx | CVE-2025-13204 | HIGH | expr-eval vulnerable to Prototype Pollution |
CVE-2025-12735 at a Glance
How to Fix CVE-2025-12735
To remediate this vulnerability, upgrade all affected Expr eval dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install expr-eval@Latest secure release
npm install expr-eval-fork@3.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls expr-eval
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-12735, inspect your project dependencies using npm:
npm ls expr-eval
Analyze the terminal output to locate any version of Expr eval in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), your application is affected.
Note: The npm ls expr-eval command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Expr eval, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-12735 Affected Expr eval Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
expr-eval
|
npm |
≤ 2.0.2
|
|
|
expr-eval-fork
|
npm |
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is CVE-2025-12735?
Which Expr eval versions are affected?
What version fixes CVE-2025-12735?
Is expr-eval affected?
Is expr-eval-fork affected?
What CWE is associated with CVE-2025-12735?
How can I check npm dependencies for CVE-2025-12735?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jc85-fpwf-qm7x",
"modified" : "2025-12-09T15:33:15Z",
"published" : "2025-11-05T03:30:23Z",
"aliases" : [ "CVE-2025-12735" ],
"summary" : "expr-eval does not restrict functions passed to the evaluate function",
"details" : "The expr-eval library is a JavaScript expression parser and evaluator designed to safely evaluate mathematical expressions with user-defined variables. However, due to insufficient input validation, an attacker can pass a crafted variables object into the evaluate() function and trigger arbitrary code execution.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "expr-eval"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "2.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "expr-eval-fork"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.0.0"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-12735"
}, {
"type" : "WEB",
"url" : "https://github.com/silentmatt/expr-eval/pull/288"
}, {
"type" : "WEB",
"url" : "https://github.com/silentmatt/expr-eval/pull/289"
}, {
"type" : "WEB",
"url" : "https://github.com/jorenbroekema/expr-eval/commit/1d71bb2ca8f98df8de00e9cc4de8fdd468a7ad43"
}, {
"type" : "WEB",
"url" : "https://github.com/jorenbroekema/expr-eval"
}, {
"type" : "WEB",
"url" : "https://github.com/jorenbroekema/expr-eval/blob/460b820ba01c5aca6c5d84a7d4f1fa5d1913c67b/test/security.js"
}, {
"type" : "WEB",
"url" : "https://github.com/silentmatt/expr-eval"
}, {
"type" : "WEB",
"url" : "https://kb.cert.org/vuls/id/263614"
}, {
"type" : "WEB",
"url" : "https://www.kb.cert.org/vuls/id/263614"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/expr-eval"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/expr-eval-fork"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-11-05T18:46:50Z",
"nvd_published_at" : "2025-11-05T01:15:33Z"
}
}