Executive brief
Cohere Terrarium is a tool used to safely run code generated by AI models in a restricted 'sandbox' environment. A security flaw allows an attacker to break out of this restricted area and gain full administrative (root) control over the underlying server or container. This could lead to the theft of sensitive data, unauthorized access to internal networks, or complete takeover of the hosting infrastructure.
Technical details
A sandbox escape vulnerability exists in Cohere Terrarium due to improper configuration of the jsglobals object in service.ts. Specifically, the mock document object is created using a standard JavaScript object literal that inherits from Object.prototype. This allows code running within the Pyodide WebAssembly environment to traverse the prototype chain to reach the function constructor and access globalThis. From there, an attacker can access Node.js internals like require() to execute arbitrary system commands as root on the host container. The vulnerability is addressed in version 1.0.1, which is the final release before the project was archived.
Affected products
- Cohere cohere-terrarium 1.0.0 and earlier
Timeline
- 2026-02-19: other: Vendor notified
- 2026-04-14: disclosed: Initial CVE publication
- 2026-04-21: advisory: CERT/CC advisory published
- 2026-04-22: patched: Version 1.0.1 released and repository archived