Critical Vulnerability in Cohere AI’s Terrarium Sandbox Allows Root Code Execution and Container Escape

A critical security flaw identified as CVE-2026-5752 has been disclosed in Terrarium, a Python-based sandbox developed by Cohere AI. The vulnerability permits attackers to execute arbitrary code with root privileges on the host machine by exploiting JavaScript prototype chain traversal techniques, posing significant risks of sandbox escape.
What happened
Researchers have disclosed a high-severity security vulnerability within Terrarium, a sandbox environment written in Python and used by Cohere AI. The flaw enables an attacker to bypass the sandbox restrictions and execute arbitrary commands with root privileges on the host process by leveraging a sandbox escape exploit through JavaScript prototype chain traversal. This vulnerability is formally tracked as CVE-2026-5752 and carries a critical CVSS score of 9.3, indicating its severity and potential impact.
Why it matters
Sandbox environments like Terrarium are designed to isolate and contain potentially harmful code executions, limiting their impact on host systems. The disclosed vulnerability undermines this core security guarantee by allowing executed code to escape containment measures, gaining elevated privileges and control over the underlying host. Such sandbox escape vulnerabilities can significantly increase the risk of system compromise, data exfiltration, or further propagation of malware within protected environments.
What security teams should do
Organizations using Terrarium sandbox should promptly review their versions and apply any patches or updates issued by Cohere AI addressing CVE-2026-5752. Security teams are advised to evaluate the scope of exposure, monitor for unusual activity indicative of exploitation attempts, and consider additional containment strategies to mitigate risk. Reviewing JavaScript execution policies and adopting layered defenses around sandboxed environments can also help prevent exploitation.
Key technical details
The vulnerability arises from how Terrarium handles JavaScript prototype chain traversal, a method that allows an attacker to manipulate inherent JavaScript inheritance properties to break out of the sandbox's constraints. By exploiting this flaw, an attacker can achieve arbitrary code execution with root-level privileges on the host process that runs the sandbox. The sandbox escape challenge is particularly critical because it defeats the layered isolation architecture expected from sandbox environments, effectively exposing the underlying system.
Affected organizations/products
This vulnerability specifically impacts the Terrarium sandbox, which is a Python-based sandbox environment used by Cohere AI. There is no information provided about exploitation in the wild or affected versions within the disclosed material.
Source attribution
https://thehackernews.com/2026/04/cohere-ai-terrarium-sandbox-flaw.html