Changeset 256578 in webkit


Ignore:
Timestamp:
Feb 13, 2020 5:54:59 PM (4 years ago)
Author:
youenn@apple.com
Message:

Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL
https://bugs.webkit.org/show_bug.cgi?id=207722

Reviewed by Chris Dumez.

  • NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:

(WebKit::WebSWServerConnection::scheduleJobInServer):
In case of bad scope, fail the job early on.

  • WebProcess/Storage/WebSWClientConnection.cpp:

(WebKit::WebSWClientConnection::scheduleJobInServer):
Remove the RELEASE_ASSERT from now since we defend in Network process.
We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up.

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r256577 r256578  
     12020-02-13  Youenn Fablet  <youenn@apple.com>
     2
     3        Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL
     4        https://bugs.webkit.org/show_bug.cgi?id=207722
     5
     6        Reviewed by Chris Dumez.
     7
     8        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
     9        (WebKit::WebSWServerConnection::scheduleJobInServer):
     10        In case of bad scope, fail the job early on.
     11        * WebProcess/Storage/WebSWClientConnection.cpp:
     12        (WebKit::WebSWClientConnection::scheduleJobInServer):
     13        Remove the RELEASE_ASSERT from now since we defend in Network process.
     14        We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up.
     15
    1162020-02-13  Ben Nham  <nham@apple.com>
    217
  • trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp

    r256432 r256578  
    273273void WebSWServerConnection::scheduleJobInServer(ServiceWorkerJobData&& jobData)
    274274{
     275    ASSERT(!jobData.scopeURL.isNull());
     276    if (jobData.scopeURL.isNull()) {
     277        rejectJobInClient(jobData.identifier().jobIdentifier, ExceptionData { InvalidStateError, "Scope URL is empty"_s });
     278        return;
     279    }
     280
    275281    SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("Scheduling ServiceWorker job %s in server", jobData.identifier().loggingString().utf8().data());
    276282    ASSERT(identifier() == jobData.connectionIdentifier());
  • trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp

    r253898 r256578  
    7474void WebSWClientConnection::scheduleJobInServer(const ServiceWorkerJobData& jobData)
    7575{
    76     RELEASE_ASSERT(!jobData.scopeURL.isNull());
    7776    runOrDelayTaskForImport([this, jobData] {
    7877        send(Messages::WebSWServerConnection::ScheduleJobInServer { jobData });
Note: See TracChangeset for help on using the changeset viewer.