The vulnerability exists in the toggle-array package because it fails to properly sanitize user-provided input for the index parameter in its enable and disable functions. These functions call an internal function initial which directly uses the index to access and modify properties of an array or object. An attacker can supply __proto__ as the index, which allows them to access the Object.prototype. When a plain JavaScript object is passed as the arr argument, this results in the ability to add or modify properties of Object.prototype. This is a classic prototype pollution vulnerability. The vulnerable functions are toggle.enable and toggle.disable, which are the public API for this package, and the internal function initial which contains the core flawed logic. Any runtime profile during exploitation would show calls to toggle.enable or toggle.disable, which in turn call initial.