The vulnerability lies in the SandboxJS execution engine, specifically in the handler for function calls made from within the sandboxed environment. The root cause was a failure to sanitize the return values of these function calls. When sandboxed code executed a native JavaScript function (e.g., Object.values(this)), the raw return value was passed back into the sandbox. The vulnerability could be triggered by calling a function that returns an array containing a reference to the host's Function constructor. With access to the Function constructor, an attacker could create and execute arbitrary code, escaping the sandbox and leading to Remote Code Execution (RCE). The patch addresses this by introducing a sanitizeArray function, which is now invoked on the return value of every function call. This new function recursively inspects arrays and replaces any references to sensitive objects like the Function constructor with their sandboxed, safe counterparts, effectively preventing the leak.