diff --git a/src/main/resources/static/js/lodash.js b/src/main/resources/static/js/lodash.js index 4131e93..8634cab 100644 --- a/src/main/resources/static/js/lodash.js +++ b/src/main/resources/static/js/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.21'; + var VERSION = '4.18.1'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -20,7 +20,8 @@ /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`', + INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -1752,6 +1753,10 @@ * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * + * **Security:** See + * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md) + * — `_.template` is insecure and will be removed in v5. + * * @static * @memberOf _ * @type {Object} @@ -2300,7 +2305,7 @@ * @name has * @memberOf SetCache * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); @@ -3766,7 +3771,7 @@ if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } + }; } return iteratee; }); @@ -4370,8 +4375,34 @@ */ function baseUnset(object, path) { path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; + + // Prevent prototype pollution: + // https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg + // https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh + var index = -1, + length = path.length; + + if (!length) { + return true; + } + + while (++index < length) { + var key = toKey(path[index]); + + // Always block "__proto__" anywhere in the path if it's not expected + if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) { + return false; + } + + // Block constructor/prototype as non-terminal traversal keys to prevent + // escaping the object graph into built-in constructors and prototypes. + if ((key === 'constructor' || key === 'prototype') && index < length - 1) { + return false; + } + } + + var obj = parent(object, path); + return obj == null || delete obj[toKey(last(path))]; } /** @@ -6922,7 +6953,7 @@ /** * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. + * `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy. * * @static * @memberOf _ @@ -7461,7 +7492,7 @@ while (++index < length) { var pair = pairs[index]; - result[pair[0]] = pair[1]; + baseAssignValue(result, pair[0], pair[1]); } return result; } @@ -14121,6 +14152,8 @@ * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * + * **Note:** If `lower` is greater than `upper`, the values are swapped. + * * @static * @memberOf _ * @since 0.7.0 @@ -14134,9 +14167,16 @@ * _.random(0, 5); * // => an integer between 0 and 5 * + * // when lower is greater than upper the values are swapped + * _.random(5, 0); + * // => an integer between 0 and 5 + * * _.random(5); * // => also an integer between 0 and 5 * + * _.random(-5); + * // => an integer between -5 and 0 + * * _.random(5, true); * // => a floating-point number between 0 and 5 * @@ -14738,6 +14778,10 @@ * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * + * **Security:** `_.template` is insecure and should not be used. It will be + * removed in Lodash v5. Avoid untrusted input. See + * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md). + * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. @@ -14845,12 +14889,18 @@ options = undefined; } string = toString(string); - options = assignInWith({}, options, settings, customDefaultsAssignIn); + options = assignWith({}, options, settings, customDefaultsAssignIn); - var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), + var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); + arrayEach(importsKeys, function(key) { + if (reForbiddenIdentifierChars.test(key)) { + throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT); + } + }); + var isEscaping, isEvaluating, index = 0,