The vulnerability is a classic prototype pollution issue in the Lodash library, specifically within the _.unset and _.omit functions. The root cause lies in the internal baseUnset function, which is responsible for deleting properties from an object based on a given path. Before the patch, this function did not validate the path, allowing an attacker to craft a path that traverses up to the object's prototype (__proto__) or its constructor's prototype. By doing so, an attacker could delete properties from global objects like Object.prototype, potentially leading to denial of service or other unexpected application behavior.
The patch addresses this by introducing validation within baseUnset to inspect the segments of the provided path. It explicitly blocks paths that contain __proto__ or a constructor.prototype sequence, thus preventing the traversal to and modification of global object prototypes.
The public-facing functions _.unset and _.omit are the primary vectors for this attack, as they both utilize the vulnerable baseUnset logic internally. The provided patch includes new test cases that specifically target these two functions with malicious paths to ensure the vulnerability is fixed and does not regress.