Course contentsShow
← Security
Lesson 1054 of 3,05222. Web Security - Client-Side and SPA SecurityFree lesson

Browser Security Features and Isolation

Learn about site isolation, process sandboxing, speculative execution mitigations, and how browsers contain JavaScript threats.

Browser Security Features and Isolation

What you'll learn: How modern browsers use multi-layered isolation techniques to contain JavaScript threats and prevent malicious code from compromising your system.


The Browser as a Security Fortress

Browsers run untrusted JavaScript code from countless websites every day. To protect your computer, they employ sophisticated isolation mechanisms that create multiple defensive layers — like security checkpoints at a high-security facility.

Site Isolation

Site Isolation ensures that different origins run in completely separate processes. If you have example.com in one tab and malicious.com in another, they run in different operating system processes with separate memory spaces. Even if malicious JavaScript exploits a vulnerability, it cannot directly access example.com's data because it's physically isolated in another process.

Process Sandboxing

Each browser process (renderer, plugin, etc.) runs inside a sandbox — a restricted environment with minimal operating system permissions. Like a child's playpen, the sandbox prevents code from accessing your file system, network, or other processes directly. All privileged operations must go through a tightly controlled browser process that validates requests.

Speculative Execution Mitigations

Modern CPUs try to predict and pre-execute code for performance (speculative execution). Attacks like Spectre exploit this to leak sensitive data. Browsers implement mitigations including:

  • Disabling high-resolution timers that attackers use for measurement
  • Isolating cross-origin content more aggressively
  • Using special CPU instructions to prevent speculative data leaks

How These Contain JavaScript Threats

When combined with Same-Origin Policy, CSP, and Trusted Types (concepts you've already learned), these browser features create defense in depth:

  1. CSP blocks malicious script loading
  2. Trusted Types prevents DOM XSS
  3. Site Isolation prevents cross-origin memory access
  4. Sandboxing prevents system compromise even if JavaScript escapes the browser's control

Key Takeaway: Modern browsers use site isolation, process sandboxing, and CPU-level mitigations to create multiple security boundaries, ensuring that even if JavaScript is malicious or exploits a vulnerability, damage remains contained and cannot spread to other sites or your operating system.