ThoughtsInWords

CORS, CORB, and ORB: How Modern Browsers Enforce Cross-Origin Isolation

Date: November 22, 2026 Last Updated: November 22, 2026 Review: Expert & Architecture Review Report

Scope & Licensing Note: This article strictly covers pure open-source systems. Premium, proprietary/vendor-locked, and community-edition (open-core) systems are currently not included.

Summary

Modern web browsers act as untrusted code execution engines. Every time you visit a website, your browser downloads and runs JavaScript from servers you do not control.

To stop malicious scripts on evil.com from reading your bank balance on bank.com, browsers enforce strict isolation boundaries centered on CORS, CORB, and ORB—three related mechanisms operating at different layers of the browser stack against different classes of threats.

Key Points


The Foundation: The Same-Origin Policy (SOP)

To understand CORS, CORB, and ORB, you first need to understand the Same-Origin Policy (SOP).

An origin is defined by three components:

Under SOP, a script running on Origin A follows three baseline rules when interacting with Origin B:

At the same time, modern web applications depend on legitimate cross-origin connectivity—such as querying weather APIs, loading fonts from CDNs, or rendering avatars from object storage. CORS, CORB, and ORB exist to balance strict isolation with safe cross-origin access.


1. CORS: Cross-Origin Resource Sharing

CORS is a standardized protocol that lets a server selectively relax the Same-Origin Policy. Instead of the browser blindly blocking every cross-origin read, CORS gives the destination server control over which origins may read its responses.

How CORS Works

When a web app issues a cross-origin request via fetch() or XMLHttpRequest, the browser automatically attaches an Origin header identifying the caller:

GET /api/user-profile HTTP/1.1
Host: api.example.com
Origin: https://app.example.com

The server inspects the Origin header and, if it trusts the requester, includes Access-Control-Allow-Origin in its response:

HTTP/1.1 200 OK
Access-Control-Allow-Origin: https://app.example.com
Content-Type: application/json

The browser then enforces one of two outcomes:

For non-simple requests, the browser adds a preflight step:

Credentialed Requests & The Vary: Origin Caching Rule

When cross-origin requests carry user credentials (cookies, TLS client certificates, or Authorization headers via credentials: "include"), browsers tighten header rules:

The Crucial Limitation of CORS

CORS has an important architectural boundary:

For years, hiding failed CORS responses from JavaScript APIs was considered sufficient. Hardware side-channel attacks broke that assumption.


2. CORB: Cross-Origin Read Blocking

In 2018, the disclosure of Spectre and Meltdown overturned a core premise of browser isolation:

CORB (Cross-Origin Read Blocking) was introduced by Chromium to close this exact gap.

How CORB Works

CORB inspects incoming cross-origin responses before they enter the renderer process hosting the web page:

  1. Identification: Flags responses explicitly labeled as data—specifically text/html, text/xml, and application/json (along with related MIME variants).
  2. Confirmation: Performs lightweight content sniffing on the first few payload bytes to verify the body actually looks like HTML, XML, or JSON rather than a mislabeled script or stylesheet.
  3. Interception: If the response is cross-origin, lacks valid CORS headers permitting the read, and is confirmed as sensitive data, CORB replaces the response body with an empty payload and strips its headers before forwarding it to the renderer process.

As a result, the <img> or <script> tag still fails gracefully as before, while sensitive bytes never touch untrusted process memory.


3. ORB: Opaque Response Blocking

While CORB closed the primary HTML, XML, and JSON leak vector, its allowlist/blocklist MIME strategy left structural blind spots:

How ORB Improves on CORB

When a cross-origin request runs in "no-cors" mode (such as via <img>, <script>, <audio>, or <video>), the browser receives an opaque response. Instead of asking “Is this response on a list of sensitive data formats?”, ORB flips the security model to default-deny: “Can we positively prove this response is a valid resource type allowed in a no-cors context?”

ORB evaluates opaque responses through a strict three-stage pipeline:

  1. CORS Bypass Check: Steps aside if valid CORS headers explicitly allow the requesting origin, since the response is no longer opaque.
  2. Safelisted Media & Script Verification: Verifies that the payload is a valid image, audio stream, video stream, stylesheet, or JavaScript file using response headers (including X-Content-Type-Options: nosniff) and rigorous content sniffing.
  3. Full Network-Level Blocking: Rather than forwarding an emptied shell like CORB, ORB aborts the response outright at the network layer as a network error whenever it cannot prove the payload is safe to embed.

By denying unknown or ambiguous responses by default, ORB provides much stronger protection against speculative execution leaks, cross-site script inclusion (XSSI), and MIME-confusion errors.

ORB Edge Cases: Range Requests & Strict nosniff Enforcement

Two production behaviors frequently surprise teams migrating endpoints under ORB:

Cross-Origin Interception Across the Browser Stack

The following diagram shows how network-service defenses (CORB and ORB) filter cross-origin payloads before they cross into renderer memory, while CORS controls JavaScript API access inside the renderer:

flowchart TD
    A["Web Page on Origin A"] -->|Cross-Origin Request| B["Browser Network Service"]
    B -->|HTTP Response from Origin B| C{"Valid CORS Headers Allow Origin A?"}

    C -->|Yes| D["Pass Response to Renderer Process"]
    D --> E["CORS Check at JS API Boundary"]
    E -->|fetch / XHR Read Allowed| F["Expose Body to JavaScript"]

    C -->|No: Opaque no-cors Subresource| G{"Network-Layer Defense: CORB vs. ORB"}
    G -->|"CORB: Confirmed HTML/XML/JSON"| H["Strip Headers & Empty Body Before Renderer"]
    G -->|"ORB: Not Proven Safe Media, CSS, or JS"| I["Abort Request with Network Error Before Renderer"]
    G -->|"ORB: Verified Image, Audio, Video, CSS, or JS"| J["Pass Opaque Subresource to Renderer Embed Only"]

    H --> K["Untrusted Renderer Memory Stays Isolated"]
    I --> K
    J --> L["CORS Still Blocks Raw Byte Reads from JS"]

4. Beyond ORB: CORP, COOP, COEP, and Site Isolation

CORB and ORB protect pages even when servers send no opt-in isolation headers. Modern open-source browser engines—Chromium (BSD-3-Clause), Firefox / Gecko (MPL-2.0), and WebKit (LGPL-2.0+ / BSD-2-Clause)—pair ORB with explicit response headers and OS-level process boundaries:


Comparing CORS, CORB, and ORB

Feature CORS CORB ORB
Full Name Cross-Origin Resource Sharing Cross-Origin Read Blocking Opaque Response Blocking
Primary Purpose Opt-in protocol allowing servers to share resources across origins Legacy defense keeping sensitive data out of renderer memory Standardized successor to CORB blocking unsafe opaque responses
Who Controls It? Server (via HTTP headers) & Browser (enforcement) Browser automatically (no server opt-in needed) Browser automatically (no server opt-in needed)
Filtering Strategy Explicit origin & method allowlisting Blocklist + sniffing for HTML, XML, and JSON Default-deny unless verified as safe media, CSS, or JS
Action on Failure Blocks JavaScript API from reading response Strips headers and empties body before renderer process Aborts with a network error before renderer process
Primary Threat Mitigated Unauthorized cross-origin API reads (CSRF / data theft) Side-channel memory reads (Spectre) via HTML/JSON/XML Side-channel reads, XSSI, and arbitrary data leaks

Practical Takeaways for Web Developers

Because CORB and ORB operate transparently inside the browser, well-configured applications rarely encounter blocks. Legacy endpoints or misconfigured headers, however, can still break subresource loads. Follow these practices to avoid unexpected failures:

DevTools Triage & Diagnostic Matrix

Mechanism Console Error vs. Network Status Response Body in DevTools Typical Root Cause Fix
CORS Console CORS error; Network tab may still show HTTP 200 Visible in Network tab (blocked only from JS APIs) Missing or mismatched Access-Control-Allow-Origin, missing Vary: Origin, or failed OPTIONS preflight Configure explicit allowlisted origins, allowed methods/headers, and Vary: Origin
CORB Console warning; subresource load completes with 0 bytes Stripped headers and empty body before renderer Cross-origin HTML, XML, or JSON loaded via <img> or <script> without CORS opt-in Consume data via fetch() with valid CORS headers instead of subresource tags
ORB Network failure (net::ERR_BLOCKED_BY_ORB) Aborted at network layer before renderer Generic Content-Type (text/plain / application/octet-stream), nosniff mismatch, or invalid 206 media range Send exact MIME types (application/json, text/javascript), valid Content-Range, or explicit CORS headers
CORP Network failure (ERR_BLOCKED_BY_RESPONSE.NotSameOrigin) Aborted before renderer Server set Cross-Origin-Resource-Policy: same-origin / same-site on a cross-origin embed Serve Cross-Origin-Resource-Policy: cross-origin (or use CORS under COEP) only for intentionally shared assets

Reference NGINX Open Source (BSD-2-Clause) Header Configuration

For teams self-hosting APIs and static assets behind NGINX Open Source (BSD-2-Clause), combine allowlisted origin reflection, Vary: Origin, strict MIME enforcement, and CORP defaults:

map $http_origin $cors_origin {
    default "";
    "https://app.example.com" $http_origin;
}

server {
    listen 443 ssl;
    server_name api.example.com;

    add_header X-Content-Type-Options "nosniff" always;
    add_header Cross-Origin-Resource-Policy "same-site" always;
    add_header Vary "Origin" always;

    if ($cors_origin != "") {
        add_header Access-Control-Allow-Origin $cors_origin always;
        add_header Access-Control-Allow-Credentials "true" always;
    }
}

Architectural Trade-Offs, Socio-Technical Pitfalls & When Not to Use CORS

Understanding browser isolation primitives also means recognizing where they stop and when a different architecture is cleaner:


References

Changelog