Skip to content

Commit f8ba8ab

Browse files
IcelandWarriorGerrit Code Review
authored andcommitted
Merge "[INTERNAL] sap.base: bump lodash to 4.17.23" into rel-1.145
2 parents b3c768e + 442218c commit f8ba8ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+85
-46
lines changed

THIRDPARTY.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ License: MIT
309309
License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
310310
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/bignumber.js
311311

312-
Component: lodash, version: 4.17.21
312+
Component: lodash, version: 4.17.23
313313
Copyright: OpenJS Foundation and other contributors
314314
License: MIT
315315
License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt

src/sap.ui.core/src/sap/base/util/restricted/_/lodash.custom.js

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license
33
* Lodash (Custom Build) <https://lodash.com/>
4-
* Build: `lodash strict include="omit,uniq,uniqBy,uniqWith,intersection,intersectionBy,intersectionWith,pick,pickBy,debounce,throttle,max,min,castArray,curry,merge,mergeWith,toArray,xor,xorBy,xorWith,isNil,difference,differenceBy,differenceWith,flatMap,flatMapDeep,flatMapDepth,isEqual,isEqualWith,without,flatten,flattenDeep,flattenDepth,compact,zipObject,zipObjectDeep,union,unionBy,unionWith"`
4+
* Build: `lodash strict include="castArray,compact,curry,debounce,difference,differenceBy,differenceWith,flatMap,flatMapDeep,flatMapDepth,flatten,flattenDeep,flattenDepth,intersection,intersectionBy,intersectionWith,isEqual,isEqualWith,isNil,max,merge,mergeWith,min,omit,pick,pickBy,throttle,toArray,union,unionBy,unionWith,uniq,uniqBy,uniqWith,without,xor,xorBy,xorWith,zipObject,zipObjectDeep"`
55
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
66
* Released under MIT license <https://lodash.com/license>
77
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -20,7 +20,7 @@ sap.ui.define(function() {
2020
var undefined;
2121

2222
/** Used as the semantic version number. */
23-
var VERSION = '4.17.21';
23+
var VERSION = '4.17.23';
2424

2525
/** Used as the size to enable large array optimizations. */
2626
var LARGE_ARRAY_SIZE = 200;
@@ -2750,8 +2750,47 @@ sap.ui.define(function() {
27502750
*/
27512751
function baseUnset(object, path) {
27522752
path = castPath(path, object);
2753-
object = parent(object, path);
2754-
return object == null || delete object[toKey(last(path))];
2753+
2754+
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
2755+
var index = -1,
2756+
length = path.length;
2757+
2758+
if (!length) {
2759+
return true;
2760+
}
2761+
2762+
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
2763+
2764+
while (++index < length) {
2765+
var key = path[index];
2766+
2767+
// skip non-string keys (e.g., Symbols, numbers)
2768+
if (typeof key !== 'string') {
2769+
continue;
2770+
}
2771+
2772+
// Always block "__proto__" anywhere in the path if it's not expected
2773+
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
2774+
return false;
2775+
}
2776+
2777+
// Block "constructor.prototype" chains
2778+
if (key === 'constructor' &&
2779+
(index + 1) < length &&
2780+
typeof path[index + 1] === 'string' &&
2781+
path[index + 1] === 'prototype') {
2782+
2783+
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
2784+
if (isRootPrimitive && index === 0) {
2785+
continue;
2786+
}
2787+
2788+
return false;
2789+
}
2790+
}
2791+
2792+
var obj = parent(object, path);
2793+
return obj == null || delete obj[toKey(last(path))];
27552794
}
27562795

27572796
/**

src/sap.ui.core/src/sap/base/util/restricted/_castArray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#castArray}
5+
* See {@link https://lodash.com/docs/4.17.23#castArray}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_castArray

src/sap.ui.core/src/sap/base/util/restricted/_compact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#compact}
5+
* See {@link https://lodash.com/docs/4.17.23#compact}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_compact

src/sap.ui.core/src/sap/base/util/restricted/_curry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#curry}
5+
* See {@link https://lodash.com/docs/4.17.23#curry}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_curry

src/sap.ui.core/src/sap/base/util/restricted/_debounce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#debounce}
5+
* See {@link https://lodash.com/docs/4.17.23#debounce}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_debounce

src/sap.ui.core/src/sap/base/util/restricted/_difference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#difference}
5+
* See {@link https://lodash.com/docs/4.17.23#difference}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_difference

src/sap.ui.core/src/sap/base/util/restricted/_differenceBy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#differenceBy}
5+
* See {@link https://lodash.com/docs/4.17.23#differenceBy}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_differenceBy

src/sap.ui.core/src/sap/base/util/restricted/_differenceWith.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#differenceWith}
5+
* See {@link https://lodash.com/docs/4.17.23#differenceWith}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_differenceWith

src/sap.ui.core/src/sap/base/util/restricted/_flatMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ${copyright}
33
*/
44
/**
5-
* See {@link https://lodash.com/docs/4.17.21#flatMap}
5+
* See {@link https://lodash.com/docs/4.17.23#flatMap}
66
*
77
* @function
88
* @alias module:sap/base/util/restricted/_flatMap

0 commit comments

Comments
 (0)