WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
183911
Warn against cookie access in the WebContent process using ProcessPrivilege assertions
https://bugs.webkit.org/show_bug.cgi?id=183911
Summary
Warn against cookie access in the WebContent process using ProcessPrivilege a...
Brent Fulgham
Reported
2018-03-22 12:38:18 PDT
Use the new ProcessPrivilege concept (see
Bug 183806
) to enforce our goal of prohibiting Cookie API access inside the WebContent process.
Attachments
Patch
(50.50 KB, patch)
2018-03-22 18:58 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(52.76 KB, patch)
2018-03-22 19:23 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(52.74 KB, patch)
2018-03-22 20:32 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(54.94 KB, patch)
2018-03-23 08:35 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(56.30 KB, patch)
2018-03-23 12:47 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(49.26 KB, patch)
2018-03-23 15:31 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(47.51 KB, patch)
2018-03-23 16:10 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews204 for win-future
(42.23 KB, application/zip)
2018-03-23 18:18 PDT
,
EWS Watchlist
no flags
Details
Patch for landing
(51.08 KB, patch)
2018-03-26 10:18 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-03-22 12:38:42 PDT
<
rdar://problem/38762306
>
Brent Fulgham
Comment 2
2018-03-22 18:58:17 PDT
Created
attachment 336344
[details]
Patch
EWS Watchlist
Comment 3
2018-03-22 19:00:21 PDT
Attachment 336344
[details]
did not pass style-queue: ERROR: Source/WebKit/WebProcess/WebProcess.cpp:223: Too many spaces inside { }. [whitespace/braces] [5] ERROR: Source/WebCore/platform/network/NetworkStorageSession.h:94: The parameter name "cookieAPI" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 28 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 4
2018-03-22 19:23:42 PDT
Created
attachment 336345
[details]
Patch
Brent Fulgham
Comment 5
2018-03-22 20:32:51 PDT
Created
attachment 336350
[details]
Patch
Brent Fulgham
Comment 6
2018-03-23 08:35:36 PDT
Created
attachment 336375
[details]
Patch
Brent Fulgham
Comment 7
2018-03-23 08:51:06 PDT
WebContent really only uses NetworkStorageSession objects to know which Session ID to use when talking to the Network process. It would be nice if NetworkStorageSession had two flavors -- one for use in the WebContent process, which didn't have any networking features in it, and another for the Network process, which could own the various platform networking API objects.
youenn fablet
Comment 8
2018-03-23 10:37:50 PDT
Comment on
attachment 336375
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=336375&action=review
> Source/WebCore/platform/network/NetworkStorageSession.h:73 > + enum class CookieAPI { Allowed, NotAllowed };
Maybe CookieAPIAccess would be clearer?
> Source/WebCore/platform/network/NetworkStorageSession.h:94 > + NetworkStorageSession(PAL::SessionID, RetainPtr<CFURLStorageSessionRef>&&, RetainPtr<CFHTTPCookieStorageRef>&&, CookieAPI);
With this API, it seems that we could have in the same process some NetworkStorageSession that have Cookie API access and some NetworkStorageSession that do not have Cookie API access. Is it what we want? If not, I wonder whether, instead of passing a parameter, we could have a process wide singleton telling whether CookieAPI access is allowed. Then we could check it at the right places without passing this value. Something like a static CookieAPI::isAllowed() and a corresponding setter that would also check the assertion. Or directly using the hasPriviledge function.
> Source/WebCore/platform/network/NetworkStorageSession.h:95 > + NetworkStorageSession(PAL::SessionID);
explicit
> Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp:82 > + m_platformCookieStorage = platformCookieStorage ? WTFMove(platformCookieStorage) : cookieAPI == CookieAPI::Allowed ? cookieStorage() : nullptr;
If cookieAPI access is not allowed, should platformCookieStorage be null? Should we assert it?
Brent Fulgham
Comment 9
2018-03-23 12:47:57 PDT
Created
attachment 336407
[details]
Patch
Brent Fulgham
Comment 10
2018-03-23 15:31:16 PDT
Created
attachment 336433
[details]
Patch
youenn fablet
Comment 11
2018-03-23 15:41:17 PDT
Comment on
attachment 336433
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=336433&action=review
> Source/WebKit/UIProcess/WebProcessPool.cpp:248 > + WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true);
We could probably use std::call_once here. Is it soon enough though? Can there be a way to use some Cookie API that would need that permission before creating a WebProcessPool?
Brent Fulgham
Comment 12
2018-03-23 16:10:09 PDT
Created
attachment 336437
[details]
Patch
youenn fablet
Comment 13
2018-03-23 16:52:00 PDT
Comment on
attachment 336437
[details]
Patch r=me. It would be nice to check that if we create a website data store, get a cookie store and modify it, we do not hit those assertions. The WebProcessPool relaxing code is probably happening too late in that scenario. An API test would tell us.
EWS Watchlist
Comment 14
2018-03-23 18:18:08 PDT
Comment on
attachment 336437
[details]
Patch
Attachment 336437
[details]
did not pass win-ews (win): Output:
http://webkit-queues.webkit.org/results/7081747
Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 15
2018-03-23 18:18:10 PDT
Created
attachment 336449
[details]
Archive of layout-test-results from ews204 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews204 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Brent Fulgham
Comment 16
2018-03-26 10:18:12 PDT
Created
attachment 336523
[details]
Patch for landing
WebKit Commit Bot
Comment 17
2018-03-26 10:55:50 PDT
Comment on
attachment 336523
[details]
Patch for landing Clearing flags on attachment: 336523 Committed
r229978
: <
https://trac.webkit.org/changeset/229978
>
WebKit Commit Bot
Comment 18
2018-03-26 10:55:52 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug