Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/ruleset/src/utils/merge-allof-schema-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ function mergeAllOfSchemaProperties(schema) {
* @param {*} sourceValue a field from the merge source
* @returns the "merged" value
*/
function customizer(targetValue, sourceValue) {
function customizer(targetValue, sourceValue, key) {
// Prevent prototype pollution by refusing to merge dangerous keys.
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
return targetValue;
}

// Allow non-object fields from the merge source to be overwritten in the target.
if (!isObject(sourceValue)) {
return sourceValue;
Expand Down