{"id":"CVE-2021-25944","aliases":["CVE-2021-25944","GHSA-h6xg-rg33-9mf4"],"related":[],"kind":"vulnerability","state":"published","title":"deep-defaults vulnerable to prototype pollution","summary":"Prototype pollution vulnerability in 'deep-defaults' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service and may lead to remote code execution.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Prototype pollution vulnerability in 'deep-defaults' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service and may lead to remote code execution.","source":"cvelist"},{"lang":"en","text":"### Overview\nPrototype pollution vulnerability in 'deep-defaults' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service and may lead to remote code execution.\n\n### Details\nThe NPM module `deep-defaults` can be abused by Prototype Pollution vulnerability since the function `_deepDefaults()` does not check for the type of object before assigning value to the property. Due to this flaw an attacker could create a non-existent property or able to manipulate the property which leads to Denial of Service or potentially Remote code execution.\n\n### PoC\nThe `_deepDefaults ()` function accepts `dest`, `src` as arguments. Due to the absence of validation on the values passed into the `src` argument, an attacker can supply a malicious value by adjusting the value to include the `__proto__` property. Since there is no validation before assigning the property to check whether the assigned argument is the Object's own property or not, the property `polluted` will be directly be assigned to the new object thereby polluting the Object prototype. Later in the code, if there is a check to validate `polluted` the valued would be substituted as \"Yes! Its Polluted\" as it had been polluted.\n\n```js\nvar deepDefaults = require(\"deep-defaults\")\nvar malicious_payload = '{\"__proto__\":{\"polluted\":\"Yes! Its Polluted\"}}';\nvar obj ={};\nconsole.log(\"Before : \" + {}.polluted);\ndeepDefaults(obj, JSON.parse(malicious_payload));\nconsole.log(\"After : \" + {}.polluted);\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"La vulnerabilidad de contaminación del prototipo en las versiones 1.0.0 hasta 1.0.5 de 'deep-defaults' permite al atacante causar una Denegación de Servicio y puede llevar a una ejecución de código remota","source":"nvd"}],"published":"2021-05-25T18:26:38.000Z","modified":"2026-06-17T03:42:39.233Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-1321"],"affected":[{"ranges":[{"version":"1.0.5, 1.0.3, 1.0.2, 1.0.1, 1.0.0","status":"affected"}],"product":"deep-defaults","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","lastAffected":"1.0.5"}],"ecosystem":"npm","package":"deep-defaults","purl":"pkg:npm/deep-defaults","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.0.0","lastAffected":"1.0.5"}],"vendor":"deep-defaults_project","product":"deep-defaults","cpe":"cpe:2.3:a:deep-defaults_project:deep-defaults:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25944","tags":["exploit","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-25944","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/d5/deep-defaults","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/d5/deep-defaults/blob/321d0e2231aa807d54e7f95d75c22048a806923f/lib/index.js#L16","tags":["web"],"sources":["ghsa"]},{"url":"https://web.archive.org/web/20210525211925/https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25944","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"Mend","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-25944","url":"https://www.cve.org/CVERecord?id=CVE-2021-25944","licence":"CVE Terms of Use","modified":"2024-08-03T20:19:18.518Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h6xg-rg33-9mf4","url":"https://github.com/advisories/GHSA-h6xg-rg33-9mf4","licence":"CC-BY-4.0","modified":"2024-04-22T23:44:02.619Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-25944","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-25944","licence":"Public domain","modified":"2026-06-17T03:42:39.233Z"}],"updatedAt":"2026-11-25T22:58:01.530Z","epss":{"score":0.02961,"percentile":0.87572,"date":"2026-12-01T12:00:22.000Z"}}