Sandboxing
Also known as: Sandbox
Security technique that runs programs in a restricted, isolated environment so that malicious or faulty code cannot harm the rest of the system.
Sandboxing confines a program to a tightly controlled environment with limited access to files, memory, network connections and other system resources. If the program is malicious, or is compromised through a vulnerability, the damage it can do is contained within the sandbox rather than spreading to the operating system or the user's data. The technique applies the principle of least privilege at the level of individual processes, and it is used both to protect everyday users and to analyze suspicious software safely.
Sandboxes appear at many layers. Web browsers isolate sites and tabs in restricted processes, so a flaw in rendering a page does not immediately expose the whole computer; Google Chrome made this design prominent when it launched in 2008. Mobile operating systems such as Android and iOS sandbox every app by default and require explicit permissions for sensitive resources. Language runtimes such as WebAssembly and JavaScript engines enforce their own boundaries, while virtual machines and containers provide heavier forms of isolation. Security analysts also run unknown files in dedicated malware sandboxes that record their behavior.
Sandboxing is a central part of defense in depth, because it assumes that some code will eventually be exploited and limits the consequences. It is not absolute: attackers seek sandbox escapes, often by chaining a second vulnerability in the operating system kernel, and such exploit chains command high prices. Overly strict sandboxes can also break legitimate functionality, so designers balance safety and usability. Operating systems built around isolation, such as Qubes OS, take the idea further by separating different activities into distinct virtual machines.
Key points
- A sandbox restricts what a program can access, containing the damage if it is malicious or compromised.
- Browsers, mobile apps, language runtimes and virtual machines all use sandboxing in different forms.
- Malware analysts run unknown files in instrumented sandboxes to observe their behavior safely.
- Sandbox escapes are possible, so sandboxing works best as one layer among several.
Related entries
Principle of Least Privilege
Security principle that every user, program and process should have only the minimum access rights needed to perform its legitimate function.
Defense in Depth
Security strategy that layers multiple independent safeguards so that if one control fails, others still protect systems and data.
Virtual Machine
Software implementation of a computer that runs its own operating system or programs in isolation from the physical hardware beneath it.
Container
Lightweight, isolated package that bundles an application with its dependencies and configuration so it runs consistently across environments.
Qubes OS
Security-focused desktop operating system that isolates different activities in separate virtual machines on the Xen hypervisor to contain compromises.
Malware
Software deliberately designed to disrupt, damage or gain unauthorized access to computers, networks or data, including viruses, worms and trojans.
Exploit
Code, input or a sequence of actions that takes advantage of a vulnerability to make a system behave in ways its designers did not intend.
GrapheneOS
Security- and privacy-hardened mobile operating system based on the Android Open Source Project and supported on Google Pixel phones.
Referenced by
Other entries that discuss or point to Sandboxing.