Changeset 256792 in webkit


Ignore:
Timestamp:
Feb 17, 2020 5:19:46 PM (4 years ago)
Author:
achristensen@apple.com
Message:

Ephemeral session data leaks between processes
https://bugs.webkit.org/show_bug.cgi?id=207404

Patch by Alex Christensen <achristensen@webkit.org> and Pavel Feldman <pavel.feldman@gmail.com> on 2020-02-17
Reviewed by Darin Adler.

Source/WebKit:

If two processes with the same bundle identifier create an ephemeral WKWebsiteDataStore, we were calling
_CFURLStorageSessionCreate with the same string, which caused our cookies to be shared. To prevent this,
add a UUID to the identifier to make them truly unique.

We don't have test infrastructure for multiple UI processes at the same time, but I manually verified
that this fixes the bug.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::ensureSession):

Source/WebKitLegacy:

  • WebCoreSupport/NetworkStorageSessionMap.cpp:

(NetworkStorageSessionMap::ensureSession):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r256790 r256792  
     12020-02-17  Alex Christensen  <achristensen@webkit.org> and Pavel Feldman <pavel.feldman@gmail.com>
     2
     3        Ephemeral session data leaks between processes
     4        https://bugs.webkit.org/show_bug.cgi?id=207404
     5
     6        Reviewed by Darin Adler.
     7
     8        If two processes with the same bundle identifier create an ephemeral WKWebsiteDataStore, we were calling
     9        _CFURLStorageSessionCreate with the same string, which caused our cookies to be shared.  To prevent this,
     10        add a UUID to the identifier to make them truly unique.
     11
     12        We don't have test infrastructure for multiple UI processes at the same time, but I manually verified
     13        that this fixes the bug.
     14
     15        * NetworkProcess/NetworkProcess.cpp:
     16        (WebKit::NetworkProcess::ensureSession):
     17
    1182020-02-17  Megan Gardner  <megan_gardner@apple.com>
    219
  • trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp

    r256700 r256792  
    8787#include <wtf/ProcessPrivilege.h>
    8888#include <wtf/RunLoop.h>
     89#include <wtf/UUID.h>
    8990#include <wtf/UniqueRef.h>
    9091#include <wtf/text/AtomString.h>
     
    511512#if PLATFORM(COCOA)
    512513    RetainPtr<CFURLStorageSessionRef> storageSession;
    513     RetainPtr<CFStringRef> cfIdentifier = String(identifierBase + ".PrivateBrowsing").createCFString();
     514    RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createCanonicalUUIDString()).createCFString();
    514515    if (sessionID.isEphemeral())
    515516        storageSession = adoptCF(createPrivateStorageSession(cfIdentifier.get()));
  • trunk/Source/WebKitLegacy/ChangeLog

    r256731 r256792  
     12020-02-17  Alex Christensen  <achristensen@webkit.org> and Pavel Feldman <pavel.feldman@gmail.com>
     2
     3        Ephemeral session data leaks between processes
     4        https://bugs.webkit.org/show_bug.cgi?id=207404
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/NetworkStorageSessionMap.cpp:
     9        (NetworkStorageSessionMap::ensureSession):
     10
    1112020-02-17  Don Olmstead  <don.olmstead@sony.com>
    212
  • trunk/Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp

    r248846 r256792  
    3131#include <wtf/ProcessID.h>
    3232#include <wtf/ProcessPrivilege.h>
     33#include <wtf/UUID.h>
    3334#include <wtf/text/StringConcatenateNumbers.h>
    3435
     
    8687        return;
    8788
    88     RetainPtr<CFStringRef> cfIdentifier = String(identifierBase + ".PrivateBrowsing").createCFString();
     89    RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createCanonicalUUIDString()).createCFString();
    8990
    9091    RetainPtr<CFURLStorageSessionRef> storageSession;
Note: See TracChangeset for help on using the changeset viewer.