← All issues

[8] [WebKit] Validate firstPartyForCookies on StartDownload/ConvertMainResourceLoadToDownload IPC

Severity: High | Component: WebKit NetworkProcess | e30ca29

Rated High because the diff adds origin validation to the NetworkProcess download-initiation IPCs that previously accepted any firstPartyForCookies URL from a compromised WebContent process; absent the check, the NetworkProcess attached the targeted site's SameSite cookies to attacker-shaped downloads.

NetworkConnectionToWebProcess::startDownload and convertMainResourceLoadToDownload validate that the supplied firstPartyForCookies is one the calling WebContent process is authorised to act for.

Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

+ MESSAGE_CHECK(allowsFirstPartyForCookies(firstPartyForCookies));
downloadManager().startDownload(...);

IPC origin-spoofing on the download path: a compromised renderer forges firstPartyForCookies and the NetworkProcess attaches the victim origin's cookies to its chosen request.

Both download-IPC receivers gain a MESSAGE_CHECK that the supplied first-party URL is one this WebContent process has legitimately loaded. Other request fields remain forwarded as before.

firstPartyForCookies is the URL the network layer uses for cookie attribution and SameSite computation. On a compromised-renderer threat model, any field crossing into the NetworkProcess must be re-validated against the per-connection knowledge of which origins the WebProcess legitimately hosts.

A compromised renderer constructed a ResourceRequest whose firstPartyForCookies() named an attacker-targeted site and sent it via Messages::NetworkConnectionToWebProcess::StartDownload. The NetworkProcess used the URL when assembling the outgoing HTTP request; NetworkStorageSession attached the user's cookies (including SameSite=Strict) for that origin. The download dispatched as if from a legitimate top-level navigation to the victim origin, riding the user's authenticated session.

🔒

How the WebContent↔NetworkProcess trust boundary breaks down when an IPC handler accepts a web-process-supplied origin field, and what a compromised renderer can do with it

Subscribe to read more

🔒

Multiple reusable IPC-validation audit patterns identified, with concrete starting points across the NetworkProcess and storage subsystems

Subscribe to read more