Cross-Origin Isolated Web Worker Proxy for Compute Acceleration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Web browsers impose security restrictions that create a tradeoff between access to restricted Web APIs, which enable web applications to utilize underlying hardware capabilities, and the ability to interoperate with other domains.
Innovation Solution
A web application architecture that operates in two portions: an unprivileged portion that does not opt into cross-origin isolation restrictions, allowing interoperation with other domains, and a privileged portion that opts into cross-origin isolation restrictions, gaining access to restricted Web APIs. An efficient communication channel is established between these portions using a proxy page and a worker instance, enabling the privileged portion to perform compute tasks on behalf of the unprivileged portion.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a web application opts into cross-origin isolation restrictions to access restricted Web APIs, then the application can utilize underlying hardware capabilities (shared memory, multithreading, high-resolution timers), but the application loses the ability to interoperate with other domains
Solution Approach 1:
The web application is divided into two separate browsing contexts: an unprivileged browsing context that maintains interoperation capabilities with other domains, and a privileged browsing context that opts into cross-origin isolation to access restricted Web APIs. This segmentation allows each context to have specialized functionality without compromising the other's capabilities.
Solution Approach 2:
A communication channel is established between the unprivileged and privileged browsing contexts, acting as an intermediary that enables the unprivileged context to request and receive results from compute tasks performed by the privileged context. This mediator allows the unprivileged application to leverage restricted APIs indirectly while maintaining its own security posture.
2Reliability
If web browsers restrict access to certain Web APIs to prevent side-channel attacks, then security is improved, but web applications cannot access shared memory, multithreading atomics, and high-resolution timers
Solution Approach 1:
The browser isolates restricted Web API access to a separate privileged browsing context that opts into cross-origin isolation. This segmentation ensures that only applications that explicitly request and are granted this isolation can access restricted APIs like SharedArrayBuffer, Atomics, and high-resolution timers, while other applications remain protected from side-channel attacks.
Solution Approach 2:
The privileged browsing context acts as an intermediary that safely provides access to restricted hardware capabilities. The unprivileged application communicates its compute task requirements through a structured channel, and the privileged context performs the actual computation using restricted APIs, returning results without exposing the unprivileged context to security risks.
3Reliability
If web browsers isolate code from remote sources from the rest of the computer system, then security is improved, but web applications cannot efficiently utilize underlying hardware capabilities
Solution Approach 1:
The browser creates a privileged browsing context with cross-origin isolation that is granted controlled access to restricted Web APIs and underlying hardware capabilities. This segmented approach maintains system-wide isolation while creating a secure enclave that can efficiently utilize hardware resources for compute-intensive tasks on behalf of unprivileged applications.
Solution Approach 2:
The privileged browsing context serves as an intermediary layer between the untrusted remote web application code and the trusted underlying hardware capabilities. It receives compute task requests, executes them with appropriate hardware access, and returns results, thereby enabling efficient hardware utilization while maintaining the security isolation boundary.
Data Source
AI summary
A device establishes a communications channel between a first web application executing within a first browsing context that is not cross-origin isolated and a second web application executing within a second browsing context that is cross-origin isolated. This includes loading a proxy page within a third browsing context of the web browser, the loading being initiated by the first browsing context, and loading a worker instance using a script provided by the proxy page. Content of the proxy page is served from an origin associated with the second web application. The device passes a first message through the communications channel from the first web application to the second web application. The first message requests the performance of a compute job by the second web application. The device also passes, from the second web application to the first web application, a second message that comprises a result of the compute job.


