Sandboxing and privilege separation
Assume the parser will be compromised and limit what it can do: the broker pattern, Chromium's process model and Rule of Two, seccomp-bpf, Landlock, pledge, AppContainer, in-process sandboxing with WebAssembly, and designing the IPC boundary.
01Plan for the bug you have not found
- Explain privilege separation and the broker pattern
- Apply Chromium's Rule of Two to decide where a sandbox is needed
- Choose between seccomp-bpf, Landlock, pledge/unveil, AppContainer and microVMs
- Design an IPC boundary that does not become the next vulnerability
Mitigations make exploitation harder; sandboxing limits what a successful exploit achieves. The idea is privilege separation: split a program so that the code handling dangerous input runs with almost no privileges, and a small, carefully written broker holds the privileges and performs only the operations the sandboxed part asks for, after checking them. OpenSSH has done this since 2002, with an unprivileged pre-authentication child handling network input.
Chromium's Rule of Two is the clearest design heuristic. Code may have at most two of these three properties: it processes untrustworthy input, it is written in an unsafe language (C or C++), and it runs with high privilege (unsandboxed). A C++ image decoder handling web content must therefore be sandboxed, or rewritten in a memory-safe language, or fed only trusted input.
| Untrusted input | Unsafe language | High privilege | Verdict |
|---|---|---|---|
| Yes | Yes | No (sandboxed) | Acceptable: the renderer model |
| Yes | No (Rust, Java, Wasm) | Yes | Acceptable: a memory-safe parser in the browser process |
| No | Yes | Yes | Acceptable: trusted data only |
| Yes | Yes | Yes | Not allowed: one bug is full compromise |
This is an advanced module
Vulnerability research & exploit mitigations is part of the Pro pass. 4 more sections — the deep dives, the final design, follow-ups and the test — unlock with it.
Already a cyart.io or studio.cyart.io member? Your pass code is in your Studio account.