Chromium allows the rendering process to run in the sandbox, so that even if the code vulnerability is exploited by the webpage, it will not pose a threat to the system.
Chromium's sandbox mechanism mainly relies on the operating system's security mechanisms, including restricted token, job object, Windows desktop, and integrity level (starting with Vista ).
Restricted tokenRestricted token inherits the access token of the currently logged-on user, and removes most of the permissions (groups and privileges). The process created using this token basically does not have the ability to access system resources.
Job objectRestricted token is based on the DACL security mechanism. For objects that cannot use DACL to control access permissions, you can use job object. Job can control the process access to user handle and clipboard, especially control the number of activated processes (job_object_limit_active_process is set to 1 to prevent sub-processes from being created ).
Job also has the following features:
- You can also close all processes that contain the job handle (job_object_limit_kill_on_job_close );
- Through the completion port, you can know the number of processes in the job (jobobject_associate_completion_port );
- Job can control whether an error report and debugging prompt (job_object_limit_die_on_unhandled_exception) are displayed when a process crashes abnormally );
- ...
Desktop objectWindows in the same desktop can send messages to each other. To prevent malicious code from stealing the window content of other processes through Windows messages, chromium places the render process on another desktop, this is the same as logon and system services on another desktop.
We usually say that Windows service programs do not have interfaces. They are not API restrictions, but because the interfaces run on another invisible desktop and users cannot interact with each other.
Integrity LevelIn Vista, you can also use the integrity level to control the running level of a process. For example, the IE7 protection mode runs at low integrity level. Using Il is relatively simple, because most objects have the default access permission medium Il. If the process running in low Il is denied, regardless of the current user identity. Even low-level il processes cannot send Windows messages to high-level il processes, even under the same desktop. How do restricted processes access resources? There are always exceptions in the world, especially when many existing Code cannot be modified, how can restricted processes be allowed to access external resources? There are several methods:
1. Use two tokens, one being initial token (with the normal permissions of the logon user) and the other being lockdown token (that is, restricted token, with most permissions removed ).
Use lockdown token as the primary access token to create a restricted process, and set (impersonate) the token of its main thread to initial token. After startup, the process can normally access system resources to complete initialization. After the initialization is complete, the process should switch to the lockdown token and close the initial token and the related handle opened during initialization.
<
SPAN style = "font-size: X-small;"> 2. Intercept win api access in a restricted process and transfer it to the control process through IPC. Based on the policy settings, determine whether to allow the operation to decide whether to continue the call on behalf of and return the result or directly refuse.
3. the control process is responsible for opening restricted resources (such as user handle) and passing the handle to restricted processes through the IPC Mechanism, so that restricted processes can use restricted resources.
Reference Chromium's sandbox design document http://dev.chromium.org/developers/design-documents/sandbox
Windows Vista for developers-Part 4-User Account controlhttp: // configure
Understanding and working in protected mode Internet Explorer
The http://msdn.microsoft.com/en-us/library/bb250462 (vs.85). aspx
How DACLs control access to an objecthttp: // msdn.microsoft.com/en-us/library/aa446683 (vs.85). aspx