ZeroHour

CVE-2026-85625

large

Prototype-pollution-chained JavaScript code execution via $where in sift.js (npm: sift)

CVSS 4.0
9.2 critical
EPSS
<1%p44
Published
()
Modified
AI analysis

sift.js 17.1.3 enumerates query keys with for...in, which walks the object prototype chain, so an inherited key such as Object.prototype.$where is dispatched as a query operator, and string $where values are compiled with new Function unless the non-default CSP_ENABLED option is set. An attacker gains arbitrary JavaScript execution by chaining any prototype-pollution bug elsewhere in the application to set Object.prototype.$where, after which even benign filter calls such as sift({}) run the injected code; alternatively, an untrusted query object containing a string $where passed directly to sift executes code under the default configuration. The impact is code execution in the host Node.js process, reflected in the critical 9.2 CVSS 4.0 score (network vector, with the required prior condition captured by the attack-requirements metric). Any application or service bundling this npm package with default settings, where untrusted queries reach sift or a prototype-pollution sink exists, is potentially affected; sift is a widely downloaded JavaScript filtering dependency, so downstream use is broad. No public proof of concept, CISA KEV listing, or in-the-wild exploitation is known, and EPSS estimates a 0.5% probability of exploitation within 30 days.

What to do: Audit dependency trees (e.g., npm ls sift) for sift 17.1.3, and review applications for prototype-pollution sources and any path where untrusted query objects containing string $where reach sift calls; upgrade to a patched release when one becomes available, since the advisory does not list a fixed version. As interim hardening, enable the CSP_ENABLED option where supported and strip or sanitize $where keys from untrusted queries before filtering.

Affected
sift.js project (npm package: sift) sift (sift.js)17.1.3 (version cited in the advisory; behavior likely present in other versions using for...in query enumeration with default $where handling, and no fixed ver
Estimated exposure
largeon the order of 1 million weekly npm downloads, implying tens of thousands of dependent applications and services — Estimate based on the npm registry's roughly 1M weekly downloads for the 'sift' package and its role as a filtering dependency in JavaScript and MongoDB-style stacks; the subset of deployments that actually reach an exploitable code path…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

sift (sift.js) 17.1.3 enumerates query keys with for...in, which walks the object prototype chain, and dispatches any matched operator key including $where. The $where operation compiles a string value into a function using new Function unless CSP_ENABLED is set (not set by default). As a result, if a prototype-pollution primitive elsewhere in the process sets Object.prototype.$where to a malicious string, even benign filter calls such as sift({}) execute arbitrary JavaScript. Additionally, passing an untrusted query object containing a string $where directly to sift results in code execution under the default configuration.

Weakness
CWE-1321
Vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.