The vulnerability was a sandbox escape caused by a host-side Error object leaking into the sandboxed environment during a failed tool call. The analysis of the patch commit ed8bc438b2cd6e6f0b5f2de321e5be6f0169b5a1 reveals two key changes that address this.
First, the introduction of a new createHostToolBridge function in libs/enclave-vm/src/tool-bridge.ts. This function acts as a secure intermediary for tool calls. The vulnerable logic existed in the predecessor to this function. When a user-provided toolHandler throws an error, the catch block in createHostToolBridge now intercepts it. Instead of propagating the raw Error object, it converts the error into a safe, serializable JSON payload. This payload contains only the error message and name, not the object's prototype chain. This is the primary fix that prevents the host object from leaking.
Second, as a defense-in-depth measure, a new utility function createSafeError was added in libs/enclave-vm/src/safe-error.ts. This function is used to create Error objects with a completely severed prototype chain by using Object.setPrototypeOf(error, null). This function is now used in multiple places within the enclave-vm codebase (including in the logic that reconstructs errors from the tool bridge) to ensure that any error generated or handled by the VM system is 'safe' and cannot be used to climb the prototype chain to access host constructors like Function.
Therefore, the function that invokes the tool handler (createHostToolBridge in the patched code) and the function used to create safe errors (createSafeError) are the critical functions related to this vulnerability and its fix.