VU#414811: Terrarium contains ... Note

VU#414811: Terrarium contains a vulnerability that allows arbitrary code execution

Terrarium is a platform designed for secure code execution in a sandbox environment. A critical vulnerability has been found within Terrarium, enabling arbitrary code execution with root privileges on the host Node.js process. This exploit stems from an issue within the Pyodide WebAssembly environment.The vulnerability originates from the way jsglobals objects are configured, specifically the mock document object. This object, created from a standard JavaScript object literal, inherits from Object.prototype. This inheritance allows sandboxed code to ascend the prototype chain to the function constructor. From there, attackers can create a function that returns globalThis, granting access to essential Node.js internals like require(). Consequently, an attacker can break out of the sandbox and run any command as root within the container.This sandbox escape vulnerability, identified as CVE-2026-5752, poses significant risks to applications relying on Terrarium. It allows attackers to execute commands as root, access and alter sensitive files, compromise internal network services, and potentially escape the container for further privilege escalation. Unfortunately, a vendor patch is currently unavailable.To mitigate this risk, disabling code submission to the sandbox, if feasible, is recommended. Network segmentation and the use of a Web Application Firewall (WAF) are also crucial to limit the attack surface and detect malicious traffic. Continuous monitoring of container activity for unusual behavior is advised. Furthermore, strict access controls and the use of secure container orchestration tools are essential. Keeping all dependencies updated and patched is a fundamental security practice. This vulnerability was discovered by Jeremy Brown using AI-assisted research.