# CVE-2025-12735: CVE-2025-12735

> Attackers can achieve arbitrary code execution in the expr-eval JavaScript library by passing crafted context objects to the evaluate function.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Nov 2025
- **Updated:** 22 Nov 2025
- **Also known as:** GHSA-jc85-fpwf-qm7x, MINI-5f9w-64w5-fj29, MINI-5q92-fx8f-48h8, MINI-67pm-4g9j-7gqw, MINI-6fq3-38wm-xpgq, MINI-6p87-g8qj-h3gp, MINI-g74w-vc85-mmh7, MINI-v8c7-mrhx-p5fh, MINI-wg3m-w8r3-vjpp, ROOT-APP-NPM-CVE-2025-12735

## What is CVE-2025-12735?

CVE-2025-12735 is a critical code injection vulnerability in expr-eval-fork expr-eval, published on 5 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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 context object or use MEMBER of the context object into the evaluate() function and trigger arbitrary code execution.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2025-12735?

4 open source packages ship an affected version, including expr-eval-fork and expr-eval. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `expr-eval-fork` | npm | All versions | 3.0.1 |
| `expr-eval-fork` | npm | All versions | 3.0.1 |
| `expr-eval` | npm | All versions to 2.0.2 | None |
| `expr-eval` | npm | All versions to 2.0.2 | None |

Products: Jorenbroekema Javascript Expression Evaluator, Silentmatt Javascript Expression Evaluator.

## How do I fix CVE-2025-12735?

Upgrade expr-eval-fork to 3.0.1 or later.

## Is CVE-2025-12735 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-12735 exists.

Public exploit code:

- Secure expression evaluator - Drop-in replacement for expr-eval without CVE-2025-12735 vulnerability (github_poc): https://github.com/alecasg555/safe-expr-eval
- Security research tool for detecting and testing CVE-2025-12735 (expr-eval RCE vulnerability) (github_poc): https://github.com/alnashawatirohwederb2167-max/cve-2025-12735-expr-eval-rce
- Security research tool for detecting and testing CVE-2025-12735 (expr-eval RCE vulnerability) (github_poc): https://github.com/AN5I/cve-2025-12735-expr-eval-rce

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-12735 and fix it if it is affected.

What it is: CVE-2025-12735 is a critical code injection vulnerability in expr-eval-fork expr-eval, published on 5 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-12735 exists.

Affected packages and fixed versions:
- expr-eval-fork (npm): affected all versions; fixed in 3.0.1
- expr-eval-fork (npm): affected all versions; fixed in 3.0.1
- expr-eval (npm): affected all versions up to 2.0.2; no fix listed
- expr-eval (npm): affected all versions up to 2.0.2; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-12735/ (Markdown: https://insights.sbomify.com/CVE-2025-12735/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-12735
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-12735
- OSV: https://osv.dev/vulnerability/CVE-2025-12735

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-12735/
Summaries are generated and may contain mistakes; the official description above is the record.
