@@ -10529,7 +10529,7 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
1052910529 var undefined;
1053010530
1053110531 /** Used as the semantic version number. */
10532- var VERSION = '4.17.21 ';
10532+ var VERSION = '4.17.23 ';
1053310533
1053410534 /** Used as the size to enable large array optimizations. */
1053510535 var LARGE_ARRAY_SIZE = 200;
@@ -14283,7 +14283,7 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
1428314283 if (isArray(iteratee)) {
1428414284 return function(value) {
1428514285 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
14286- }
14286+ };
1428714287 }
1428814288 return iteratee;
1428914289 });
@@ -14887,8 +14887,47 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
1488714887 */
1488814888 function baseUnset(object, path) {
1488914889 path = castPath(path, object);
14890- object = parent(object, path);
14891- return object == null || delete object[toKey(last(path))];
14890+
14891+ // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
14892+ var index = -1,
14893+ length = path.length;
14894+
14895+ if (!length) {
14896+ return true;
14897+ }
14898+
14899+ var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
14900+
14901+ while (++index < length) {
14902+ var key = path[index];
14903+
14904+ // skip non-string keys (e.g., Symbols, numbers)
14905+ if (typeof key !== 'string') {
14906+ continue;
14907+ }
14908+
14909+ // Always block "__proto__" anywhere in the path if it's not expected
14910+ if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
14911+ return false;
14912+ }
14913+
14914+ // Block "constructor.prototype" chains
14915+ if (key === 'constructor' &&
14916+ (index + 1) < length &&
14917+ typeof path[index + 1] === 'string' &&
14918+ path[index + 1] === 'prototype') {
14919+
14920+ // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
14921+ if (isRootPrimitive && index === 0) {
14922+ continue;
14923+ }
14924+
14925+ return false;
14926+ }
14927+ }
14928+
14929+ var obj = parent(object, path);
14930+ return obj == null || delete obj[toKey(last(path))];
1489214931 }
1489314932
1489414933 /**
0 commit comments