Skip to content
Open
Show file tree
Hide file tree
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
32 changes: 16 additions & 16 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 43 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3450,7 +3450,7 @@ function copyFile(srcFile, destFile, force) {
var undefined;

/** Used as the semantic version number. */
var VERSION = '4.17.21';
var VERSION = '4.17.23';

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
Expand Down Expand Up @@ -7204,7 +7204,7 @@ function copyFile(srcFile, destFile, force) {
if (isArray(iteratee)) {
return function(value) {
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
}
};
}
return iteratee;
});
Expand Down Expand Up @@ -7808,8 +7808,47 @@ function copyFile(srcFile, destFile, force) {
*/
function baseUnset(object, path) {
path = castPath(path, object);
object = parent(object, path);
return object == null || delete object[toKey(last(path))];

// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
var index = -1,
length = path.length;

if (!length) {
return true;
}

var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');

while (++index < length) {
var key = path[index];

// skip non-string keys (e.g., Symbols, numbers)
if (typeof key !== 'string') {
continue;
}

// Always block "__proto__" anywhere in the path if it's not expected
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
return false;
}

// Block "constructor.prototype" chains
if (key === 'constructor' &&
(index + 1) < length &&
typeof path[index + 1] === 'string' &&
path[index + 1] === 'prototype') {

// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
if (isRootPrimitive && index === 0) {
continue;
}

return false;
}
}

var obj = parent(object, path);
return obj == null || delete obj[toKey(last(path))];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"bluebird": "3.7.2",
"codeowners-utils": "1.0.2",
"js-yaml": "4.1.1",
"lodash": "4.17.21",
"lodash": "4.17.23",
"micromatch": "4.0.8",
"simple-git": "3.30.0"
},
Expand All @@ -36,9 +36,9 @@
"husky": "9.1.7",
"jest": "30.2.0",
"plop": "4.0.4",
"prettier": "3.7.4",
"prettier": "3.8.1",
"typescript": "5.9.3",
"typescript-eslint": "8.53.0"
"typescript-eslint": "8.53.1"
},
"jest": {
"clearMocks": true,
Expand Down