← All reports

Network-process origins declared `IPC::Untrusted`

Component: WebKit Networking Process | b15cc99

Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp

-void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name)
+void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, IPC::Untrusted<WebCore::ClientOrigin>&& untrustedOrigin, const String& name)
{
+ auto origin = WTF::move(untrustedOrigin).unsafeExtractWithoutValidation(IPC::UnvalidatedReason::NeedsReview);
MESSAGE_CHECK(isValidClientOrigin(origin), connection);

Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.messages.in

- RegisterChannel(struct WebCore::ClientOrigin origin, String name)
+ RegisterChannel(struct IPC::Untrusted<WebCore::ClientOrigin> origin, String name)

The network process holds cookies, storage, service workers, caches and sockets for all origins, while a WebContent process is assumed to be attacker-controlled after a renderer compromise. Under site isolation, each IPC handler that accepts an origin, site or domain must check that the sender may claim it. IPC::Untrusted<T> is a wrapper type that forces the receiver either to run a validation procedure or to call unsafeExtractWithoutValidation with an explicit reason. Code generated from messages.in enforces this at the type level.

This commit wraps every origin, site and domain that WebContent sends to the network process in IPC::Untrusted<>, and the messages.in generator now enforces the wrapper for the network process as it already did for the UI process. The affected handlers cover broadcast channel, storage, service worker, shared worker, WebRTC, socket, blob, download and storage-access messages. Each handler unwraps with UnvalidatedReason::NeedsReview and keeps its existing MESSAGE_CHECKs.

The commit also adds several pieces that are not yet wired in or that restructure existing checks:

No behavior change is intended; a follow-up will swap NeedsReview for real validation. Every NeedsReview extraction is now a compile-time-visible marker of where the network process trusts a compromised renderer's claimed origin.

Use the NeedsReview call sites as a map of the network process's trust boundary. Compare each handler's MESSAGE_CHECKs against what the new validation procedures would require. Handlers that use the origin with no check, or with only a weak one such as isValidClientOrigin, are candidates for cross-origin storage, cache, service worker or cookie access from a compromised renderer. Prioritize:

The refactoring pattern itself generalizes. When an IPC handler is bypassed by a direct internal call, as launchSharedWorker() now does with registerServiceWorkerClientInternal(), any validation that lived only in the IPC handler is silently skipped on the new path. Check what the RegisterServiceWorkerClient handler enforced. Log-and-drop macros like STORAGE_EXTRACT_WITH_MESSAGE_CHECK are a related risk: once the follow-up lands, a validated storage path may continue silently after a failed check instead of terminating the sender.