3 ms·
One process per sandbox will get you far, if all you want is to execute something. I would go as far as say it is pretty easy.
by pastage 10mo ago
One process per sandbox will get you far, if all you want is to execute something. I would go as far as say it is pretty easy.
- simonw 10mo agoI want to execute untrusted code. This makes it very difficult indeed.
- mike_hearn 10mo agoWhat's wrong with V8? You could also look at GraalJS. It's shipped as part of the Oracle Database, there's a security team, patching process etc. It's used in production by Amazon amongst others. It's got flexible sandbox features too. https://www.graalvm.org/latest/reference-manual/embed-languages/#access-privilege-configuration https://www.graalvm.org/latest/reference-manual/embed-langua... The way it's written is good for security as well: https://medium.com/graalvm/writing-truly-memory-safe-jit-compilers-f79ad44558dd https://medium.com/graalvm/writing-truly-memory-safe-jit-com... Disclosure: I sit next to the GraalVM team.
- simonw 10mo agoThe challenge with V8 is finding a wrapper for it that doesn't come with a big warning NOT to use it as a sandbox for untrusted code - here's the workerd one https://github.com/cloudflare/workerd?tab=readme-ov-file#warning-workerd-is-not-a-hardened-sandbox https://github.com/cloudflare/workerd?tab=readme-ov-file#war... and here's the PyMiniRacer section: https://bpcreech.com/PyMiniRacer/architecture/#security-goals https://bpcreech.com/PyMiniRacer/architecture/#security-goal... I looked at GraalVM but was put off by the licensing situation: https://www.graalvm.org/22.3/reference-manual/embed-languages/sandbox-resource-limits/ https://www.graalvm.org/22.3/reference-manual/embed-language... > GraalVM Enterprise provides the experimental Sandbox Resource Limits feature that allows for the limiting of resources used by guest applications. These resource limits are not available in the Community Edition of GraalVM. Part of my requirements for a sandbox are strong guarantees against memory or CPU exhaustion from poorly written or malicious code.
- mike_hearn 10mo agoLicensing has changed since that release. You can use the EE for free, both for personal and commercial use cases: https://www.graalvm.org/latest/introduction/#licensing-and-support https://www.graalvm.org/latest/introduction/#licensing-and-s... > Oracle GraalVM is licensed under GraalVM Free Terms and Conditions (GFTC) including License for Early Adopter Versions. Subject to the conditions in the license, including the License for Early Adopter Versions, the GFTC is intended to permit use by any user including commercial and production use. It has all the sandboxing features you might want. I don't know if the disclaimers on the other engines changes much, open source software always disclaims all liability. Nobody will stand behind something security sensitive unless it's commercial because otherwise there's no way to pay for the security team it requires.