← All issues

Web Inspector: BackendResourceDataStore for Site Isolation response bodies

ccf6c82

Source/WebKit/WebProcess/Inspector/WebInspectorBackend.messages.in

+ GetResponseBody(String requestId) -> (String body, bool base64Encoded, String errorMessage) Async

Source/WebCore/inspector/InspectorIdentifierRegistry.h

+ std::optional<DeterministicRequestId> parseDeterministicRequestId(const String&);

Source/JavaScriptCore/inspector/protocol/Network.json

- { "name": "getResponseBody", ... }
+ { "name": "getResponseBody", "async": true, ... }

Under WebKit's Site Isolation, cross-origin iframes run in separate WebContent processes. Web Inspector's UIProcess hosts ProxyingNetworkAgent which proxies CDP-style commands to per-frame agents in the appropriate WebProcess. Previously, Network.getResponseBody was synchronous and relied on CachedResource references in NetworkResourcesData — a structure that does not cross process boundaries.

This commit adds BackendResourceDataStore, a WebProcess-side buffer for HTTP response metadata and content that lives in each WebProcess, copies response data at instrumentation time (decoupled from CachedResource lifetime), and is owned by WebInspectorBackend. Network.getResponseBody is converted from synchronous to asynchronous. ProxyingNetworkAgent parses frontend-provided requestId strings via parseDeterministicRequestId to extract the target WebProcess identifier, then sends an async GetResponseBody IPC message to that process.

This commit extends Web Inspector's reach across Site Isolation process boundaries by introducing a new IPC path and requestId-based routing mechanism — any trust or validation bugs here could allow the inspector frontend to exfiltrate response bodies from WebProcesses it should not reach.

🔒

The new IPC routing logic parses frontend-controlled identifiers to target WebProcesses — actionable audit directions are included for this path.

Subscribe to read more