Prototype Pollution
Description
js-data is vulnerable to Prototype Pollution via the deepFillIn function, allowing attackers to inject properties into Object.prototype.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
js-data is vulnerable to Prototype Pollution via the deepFillIn function, allowing attackers to inject properties into Object.prototype.
Vulnerability
Overview
CVE-2020-28442 affects all versions of the js-data JavaScript library. The vulnerability is a Prototype Pollution issue in the deepFillIn function, which recursively merges objects without proper sanitization of special properties like __proto__, constructor, or prototype [1][2]. This allows an attacker to pollute the base Object prototype by injecting properties through a crafted object.
Exploitation
An attacker can exploit this by providing a malicious JSON payload containing a __proto__ property to any application that uses js-data's deepFillIn function to merge user-controlled data. No authentication is required if the application exposes an endpoint that processes such input. The attack leverages unsafe recursive merge logic, as described in the Snyk advisory [2].
Impact
Successful exploitation leads to Prototype Pollution, which can cause denial of service via JavaScript exceptions or, more critically, tamper with application logic to force code paths that may lead to remote code execution [2]. Since polluted properties are inherited by all objects, the impact can be widespread across the application.
Mitigation
The issue was fixed in a pull request and commit that added checks for magic attributes like __proto__ during deep merge operations [3][4]. Users should update to a patched version of js-data. No workaround is provided; upgrading is the recommended action.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
js-datanpm | < 3.0.10 | 3.0.10 |
Affected products
2- js-data/js-datadescription
Patches
12d9eed5d3e97Security Fix for Prototype Pollution - huntr.dev (#574)
2 files changed · +14 −0
src/utils.js+5 −0 modified@@ -70,6 +70,10 @@ const mkdirP = function (object, path) { return object } +const isPrototypePolluted = function (key) { + return ['__proto__', 'prototype', 'constructor'].includes(key) +} + const utils = { /** * Reference to the Promise constructor used by JSData. Defaults to @@ -446,6 +450,7 @@ const utils = { deepMixIn (dest, source) { if (source) { for (var key in source) { + if (isPrototypePolluted(key)) continue const value = source[key] const existing = dest[key] if (isPlainObject(value) && isPlainObject(existing)) {
test/unit/utils/extendUtils.test.js+9 −0 modified@@ -54,6 +54,15 @@ describe('utils.deepMixIn', function () { assert.deepEqual(expected, actual, 'sorce own properties recursivly copied and overriden into dest') assert.equal(dest, utils.deepMixIn(dest), 'empty source argument returns dest') }) + + it('Recursively shallow copies properties from `source` to `dest`', function () { + const dest = {} + const src = JSON.parse('{"__proto__":{"polluted":"Yes! Its Polluted"}}') + utils.deepMixIn(dest, src) + + assert.equal(dest.polluted, undefined, 'dest must not overwrite prototype constructor') + assert.equal({}.polluted, undefined, 'must prevent prototypical inherited values') + }) }) describe('utils.extend', function () {
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-mqgv-67vx-g4m5ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-28442ghsaADVISORY
- github.com/js-data/js-data/blob/master/src/utils.js%23L417mitrex_refsource_MISC
- github.com/js-data/js-data/commit/2d9eed5d3e9710d7e7fecc6f6437c39fe73a4097ghsaWEB
- github.com/js-data/js-data/pull/574ghsaWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWER-1050978mitrex_refsource_MISC
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1050979mitrex_refsource_MISC
- snyk.io/vuln/SNYK-JS-JSDATA-1023655ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.