From 3357ef753871b394b825d15429ceb27b26e24d63 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 20 May 2022 11:08:37 -0700 Subject: [PATCH] fix: do not let setProperty change the prototype (#1731) --- src/util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.js b/src/util.js index 5ae88cc7f..c39d33a6a 100644 --- a/src/util.js +++ b/src/util.js @@ -176,6 +176,9 @@ util.decorateEnum = function decorateEnum(object) { util.setProperty = function setProperty(dst, path, value) { function setProp(dst, path, value) { var part = path.shift(); + if (part === "__proto__") { + return dst; + } if (path.length > 0) { dst[part] = setProp(dst[part] || {}, path, value); } else {