Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 84a08d4a5ba8ac7864f2bcbd4b5ba41e387585c6
      
https://github.com/WebKit/WebKit/commit/84a08d4a5ba8ac7864f2bcbd4b5ba41e387585c6
  Author: Kristian Monsen <[email protected]>
  Date:   2026-05-20 (Wed, 20 May 2026)

  Changed paths:
    A LayoutTests/ipc/create-socket-channel-invalid-url-crash-expected.txt
    A LayoutTests/ipc/create-socket-channel-invalid-url-crash.html
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
    M Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

  Log Message:
  -----------
  NetworkConnectionToWebProcess::createSocketChannel should reject requests 
with an invalid URL
https://bugs.webkit.org/show_bug.cgi?id=315163
rdar://177347637

Reviewed by Chris Dumez.

A fuzzed CreateSocketChannel IPC message carrying a ResourceRequest with
an invalid URL reaches NetworkSessionCocoa::createWebSocketTask, which
materializes an NSURLRequest with a nil URL and passes it to
-[NWURLSession webSocketTaskWithRequest:]. NWURLSession throws
NSInvalidArgumentException, which propagates uncaught and aborts the
Networking process.

A well-behaved WebContent process never sends an invalid URL on this path
(WebSocket::connect rejects it), so add a MESSAGE_CHECK at the IPC entry
point. As defense in depth, also bail out of createWebSocketTask when the
NSURLRequest has a nil URL, mirroring the existing nil-request guard.

* LayoutTests/ipc/create-socket-channel-invalid-url-crash-expected.txt: Added.
* LayoutTests/ipc/create-socket-channel-invalid-url-crash.html: Added.
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::createSocketChannel):
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::createWebSocketTask):

Canonical link: https://commits.webkit.org/313603@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to