Cross-origin isolation and SharedArrayBuffer clocks
Sites that send COOP and COEP headers unlock finer timers and SharedArrayBuffer.
In one line
Can use a very fine clock and shared memory, but only if the site opts in
Sites that send COOP and COEP headers unlock finer timers and SharedArrayBuffer.
Gives a page a 5 microsecond clock and shared memory, both needed for wasm threads. A worker counter on SharedArrayBuffer is a high resolution clock that also powers Spectre-class attacks.
What it can and can't do
What the user does: Nothing. The site sets special page headers when it loads
It can
- Get a clock down to about 5 microseconds
- Share memory between its own background workers
- Run heavier tools such as WebAssembly threads
- Use these also for very precise timing attacks
It cannot
- Get these without the special page headers
- Load some outside content like ads and embeds freely
- Ask permission first
- Work in older browsers
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 92 | 2021-07-20 | None |
| Edge | Supported | 92 | 2021-07-22 | None |
| Firefox | Supported | 79 | 2020-07-28 | None |
| Safari | Supported | 15.2 | 2021-12-13 | None |
| Safari on iPhone | Supported | 15.2 | 2021-12-13 | None |
| Chrome on Android | Supported | 92 | 2021-07-20 | None |
| Samsung Internet | Supported | 16.0 | 2021-11-25 | None |
How a site asks for it
| API | Cross-Origin-Opener-Policy: same-origin; Cross-Origin-Embedder-Policy: require-corp; self.crossOriginIsolated |
| Browser compat keys | api.Window.crossOriginIsolated |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Send COOP and COEP headers
- Check crossOriginIsolated
- Use SharedArrayBuffer and performance.now at finer resolution
Data you get
What comes back: crossOriginIsolated true or false
Shape: boolean
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
crossOriginIsolated | boolean | None | true or false | exact |
timer resolution | float | microseconds | 5 (Chrome), 20 (Firefox) | fixed |
Technical limits
- Isolation blocks embedding non-CORP cross-origin content
- Not available in iframes without allow and the same headers
The story
What it is
Sites that send two special headers unlock very precise timers and shared memory for heavy apps.
For you
You do not choose or see this. Heavy web apps like big games or video editors run faster in a tab, because the site proved it is walled off from others.
For makers
Isolation unlocks threads, shared memory and finer timers, which are needed for fast code. The cost is that the site must prove all content it loads is safe, which can be hard with ads and embeds.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A big web game built with Unity or Unreal uses several threads in a tab, which needs isolation to run well. | Unity WebGL games |
| creative | A browser video tool like ffmpeg.wasm runs faster with shared memory. | Clipchamp, Photopea |
| developer | A code editor in the browser runs a whole dev server in a tab using threads. | StackBlitz, VS Code web |
| music | A web DAW processes many audio tracks at once on several threads without crackles. | Soundtrap |
| productivity | A design or spreadsheet app runs heavy calculations on many threads in the browser. | Figma, Google Sheets |
| security | Researchers use finer timers to study side channel attacks, which is why browsers wall these timers off. | None named |
| education | A browser based coding class runs Python in a tab with shared memory so lessons feel fast. | Pyodide demos |
Risks
- Embeds and ads can break
- Makes timing attacks easier if misused
What the platform says
- web.dev: Cross origin isolation guide. Google explains how to turn on isolation so a page can use powerful features like shared memory safely.
- web.dev: Why COOP and COEP. Explains that isolation makes powerful features safe because it blocks risky mixing with other sites.
Good uses and abuse
Legitimate uses
- WebAssembly threads, ffmpeg.wasm, video editors
Known abuse
- Enables micro-timing side channels in a compromised cross-origin context
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
History
- 2018-01, all: SharedArrayBuffer disabled after Spectre
- 2020-07, Chrome 92: SAB re-enabled for cross-origin isolated pages
- 2021-01, Firefox 79: SAB re-enabled for isolated pages
- 2021-12, Safari 15.2: Cross-origin isolation and SAB supported
Related capabilities
Related
- High resolution timer precision. Can use a clock whose sharpness shows your browser and privacy mode
- Microarchitectural timing attacks (Spectre, DrawnApart, cache side channels). Can use very exact timing to learn how your processor or graphics chip behaves
Sources
How well checked: Based on official documentation.