External risk intelligence

npm expr-eval Prototype Pollution Leads to Code Execution

CVE advisorySeverity: CRITICAL (CVSS 9.8)

CVE-2025-13204

The vulnerability exists in a library used to parse and evaluate mathematical expressions. While it can be incorporated into internet-facing applications that allow user-supplied expressions, the library itself is a general-purpose component and not inherently an edge service, gateway, or public-facing portal by design.

Silentmatt Javascript Expression Evaluator

Halo Surface Signal: 3 out of 5 — possibly public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory concerns a critical vulnerability in the `expr-eval` npm package, a component used for evaluating JavaScript expressions. An attacker could potentially exploit this weakness to execute arbitrary code, which could lead to a broad range of security compromises if the affected interface is exposed. The primary concern is to confirm if and where this library is used within our systems to assess potential exposure.

  • Allows code execution via expression evaluation.
  • Critical flaw impacts expression evaluation libraries.
  • Confirm usage to assess potential exposure.

Attack Path

How an attacker could exploit the issue

An attacker can exploit this vulnerability by sending a specially crafted JavaScript expression to an application that uses the `expr-eval` library. This malicious input manipulates the library's internal handling of JavaScript's prototype-based inheritance, potentially allowing the attacker to execute arbitrary code within the application's environment.

  • No special access needed.
  • Triggered by a user-supplied expression.
  • Risk of arbitrary code execution.

Live Threat

Current exploitation, exposure, and threat context

This vulnerability could allow an attacker to execute arbitrary code when an application using the `expr-eval` library processes specially crafted JavaScript expressions, potentially affecting the integrity and availability of the affected system.

  • Arbitrary code execution.
  • Processing of malicious expressions.
  • System compromise.

Operational Fix

Recommended remediation, mitigation, and detection steps

The npm package `expr-eval` is susceptible to prototype pollution, potentially leading to arbitrary code execution if an attacker can interact with the evaluation interface. Ownership likely falls to the application team responsible for integrating and managing this dependency, with potential collaboration from infrastructure or platform teams if the library is part of a shared service. The first practical step is to identify all instances of the affected package, assess their reachability and criticality, and then engage the accountable owner to plan remediation.

  • Application owners should manage this issue.
  • Verify all affected deployments and exposures.
  • Coordinate vendor updates and plan maintenance.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the silentmatt javascript_expression_evaluator package?

This package, widely known as expr-eval, is a library for Node.js environments that allows developers to parse and calculate mathematical expressions dynamically. It acts as a utility tool within custom software to process user-provided formulas, rather than being a standalone application or server itself.

What does CVE-2025-13204 mean by Prototype Pollution?

It refers to CWE-1321, a weakness where an attacker injects properties into the base object prototype in JavaScript. Because JavaScript objects share this prototype, the injected property becomes available to all objects, which this library erroneously allows an attacker to manipulate to gain control over code execution.

How is this prototype pollution vulnerability triggered?

An attacker triggers the flaw by submitting a specially crafted expression through an application's interface that utilizes the library. It does not trigger via standard, legitimate mathematical inputs; the expression must be intentionally designed to exploit the library's internal logic for handling object properties.

Is my system at risk if I use expr-eval?

Halo Surface Signal indicates that while the library is not inherently an internet-facing gateway, your risk depends on whether your application exposes an interface that accepts user-supplied expressions from the internet. If the library is used only in internal, non-interactive workflows, the practical risk is significantly reduced.

How do I address this security flaw?

Begin by auditing your dependency tree to confirm where expr-eval is implemented within your applications. Once identified, evaluate if the component can be removed or replaced. If the library remains necessary, coordinate with your development teams to migrate to a patched alternative, such as expr-eval-fork, which addresses the issue.

References