V8 isolates & QuickJS is *not* secure by default
Seeing a lot of mistakes like:
- Running in the same process as your backend → one V8 CVE reads your API keys
- Exposing 𝙳𝚊𝚝𝚎.𝚗𝚘𝚠() → Spectre
- Removing 𝙳𝚊𝚝𝚎.𝚗𝚘𝚠() but keeping network → the network is a clock → Spectre x2
- Guest 𝚏𝚎𝚝𝚌𝚑() → SSRF to unauthed internal services
- Not whitelisting egress → botnets
- Traversal & symlink escapes in filesystem API
- Timeouts that can't actually kill 𝚠𝚑𝚒𝚕𝚎(𝚝𝚛𝚞𝚎){}
- Bad OOM guards → try 𝚗𝚎𝚠 𝙰𝚛𝚛𝚊𝚢(𝟷𝚎𝟿)
We put a lot of time into security with agentOS & Secure Exec
(WebAssembly-based Linux sandbox)
Instead, we follow the Cloudflare Workers & Chromium model.
Some functionality we put in place:
- Run isolates in a separate sidecar process
- Spectre timing mitigations
- Virtual operating system → full Linux that never touches the host
- Event pump that can preempt a hot loop
- OOM contained to VM, bounded limits, & monitoring for everything
- Deny-by-default egress, explicit allowlist
- (Soon) jail the sidecar process