RESOLVED FIXED 211211
Add SPI to change a WKWebView's CORS disabling pattern after initialization
https://bugs.webkit.org/show_bug.cgi?id=211211
Summary Add SPI to change a WKWebView's CORS disabling pattern after initialization
Alex Christensen
Reported 2020-04-29 17:17:39 PDT
Add SPI to change a WKWebView's CORS disabling pattern after initialization
Attachments
Patch (14.87 KB, patch)
2020-04-29 17:20 PDT, Alex Christensen
no flags
patch with renamed parser (14.94 KB, patch)
2020-04-30 12:25 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-04-29 17:20:01 PDT
Alex Christensen
Comment 2 2020-04-29 17:20:03 PDT
Chris Dumez
Comment 3 2020-04-30 11:41:58 PDT
Comment on attachment 398011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398011&action=review > Source/WebKit/WebProcess/WebPage/WebPage.cpp:403 > + WebCore::SecurityPolicy::allowAccessTo(parsedPattern); This method says it is parsing things, however it is calling SecurityPolicy::allowAccessTo() too so it is doing way more than parsing. Another concern. Even though you now support updating those CORS-disabling patterns, you really only ever allow more patterns with regards to SecurityPolicy::originAccessPatterns(). Once a pattern is added there, it does not seem it gets removed. Another mismatch is that SecurityPolicy::originAccessPatterns() seems to apply at process level, while you patterns are per page.
Alex Christensen
Comment 4 2020-04-30 11:54:55 PDT
The user of this SPI will only ever be adding patterns, so this concern isn't really valid for this use case. It is valid for hypothetical future users of this SPI that reduce patterns, but we should cross that bridge when we come to it. It is unfortunate that SecurityPolicy is global, but it is the way it is right now. All loading in the web process is global. Would you review this patch on the condition that parseCORSDisablingPatterns be renamed to parseAndAllowAccessToCORSDisablingPatterns?
Alex Christensen
Comment 5 2020-04-30 12:25:31 PDT
Created attachment 398080 [details] patch with renamed parser
EWS
Comment 6 2020-04-30 13:03:32 PDT
Committed r260962: <https://trac.webkit.org/changeset/260962> All reviewed patches have been landed. Closing bug and clearing flags on attachment 398080 [details].
Note You need to log in before you can comment on or make changes to this bug.