Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

CVE-2022-37614 - resolve prototype pollution vuln #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chris-tuncap
Copy link

@chris-tuncap chris-tuncap commented Aug 16, 2023

CVE-2022-37614/Prototype pollution found in mockery.js

Resolve prototype pollution vulnerability by only mapping fields that exist in the defaultOptions object from the user provided opts object.

Default:

defaultOptions = {
    useCleanCache: false,
    warnOnReplace: true,
    warnOnUnregistered: true
}

User provided:

opts = {
    other1: 2,
    other2: 5,
    warnOnUnregistered: false
}

Result:

effectiveOptions = {
    useCleanCache: false,
    warnOnReplace: true,
    warnOnUnregistered: false  // <-- updated
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants