The vulnerability exists in the set-in library because it relies on Array.prototype.includes to sanitize user-provided paths and prevent prototype pollution. The core of the issue lies in the recursivelySetIn function, which is called by the main setIn function. This function checks if any segment of the input path is a forbidden key (like __proto__ or constructor) using POLLUTED_KEYS.includes(key). As demonstrated in the proof-of-concept, an attacker can override Array.prototype.includes to make it return false. This effectively disables the security check, allowing the function to write to Object.prototype and pollute it with arbitrary properties. This can lead to serious security consequences like denial of service, authentication bypass, or even remote code execution in applications that use this library. The patches show several attempts to fix this by moving the check between the recursivelySetIn and set functions, but the fundamental flaw of using a mutable includes method on a built-in prototype remained until the final patched version.