mfncooper / mockery

Simplifying the use of mocks with Node.js
Other
1.1k stars 60 forks source link

CVE-2022-37614-Patch - Preventing prototype pollution #79

Closed wesleyscholl closed 11 months ago

wesleyscholl commented 1 year ago

CVE-2022-37614-Patch - Preventing prototype pollution by freezing the options object

Patch to the vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2022-37614

Updates

getEffectiveOptions

enable

Code Changes

// New code: for (key, value in opts) { options[key] = value; }

- ***enable***
```js
// Prevent prototype pollution by freezing the options object
  options = Object.freeze(options);