Bug 194664 - REGRESSION (r240446): Storage Access API does not handle domains properly
Summary: REGRESSION (r240446): Storage Access API does not handle domains properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 193199
  Show dependency treegraph
 
Reported: 2019-02-14 12:49 PST by Brent Fulgham
Modified: 2019-02-18 14:48 PST (History)
6 users (show)

See Also:


Attachments
Patch (30.57 KB, patch)
2019-02-14 12:56 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2019-02-14 12:49:17 PST
During my refactoring of the ResourceLoadStatistics code, I introduced two bugs:
(1) I neglected to be consistent in my use of 'primaryDomain', causing some Storage Access API code paths to store approves under one domain (e.g., 'www.example.com'), while checking status under the eTLD+1 (e.g., 'example.com'). The exact string matching requirement caused these to get missed.

(2) I used a move operator before a final set of copies of domain names, leading to some empty strings being passed to Storage Access API calls.

Both issues are corrected in this patch.
Comment 1 John Wilander 2019-02-14 12:55:18 PST
This is another example of why I really should introduce a registrableDomain class so we can get type safety to save us. We’re using it in so many places now – ITP, SameSite cookies, partitioning, Ad Click Attribution, and PSON (afaik). I might do this next week.
Comment 2 Radar WebKit Bug Importer 2019-02-14 12:55:37 PST
<rdar://problem/48084628>
Comment 3 Brent Fulgham 2019-02-14 12:56:16 PST
Created attachment 362051 [details]
Patch
Comment 4 Alex Christensen 2019-02-14 13:02:36 PST
Comment on attachment 362051 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362051&action=review

> Source/WebKit/ChangeLog:17
> +        Both issues are corrected in this patch.

Are there any tests to make sure we don't do this again?
Comment 5 John Wilander 2019-02-14 13:21:10 PST
(In reply to Alex Christensen from comment #4)
> Comment on attachment 362051 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362051&action=review
> 
> > Source/WebKit/ChangeLog:17
> > +        Both issues are corrected in this patch.
> 
> Are there any tests to make sure we don't do this again?

The problem is that our layout tests don’t support subdomains. That’s why we missed this once earlier. Type safety should fix it.
Comment 6 WebKit Commit Bot 2019-02-14 17:55:32 PST
Comment on attachment 362051 [details]
Patch

Clearing flags on attachment: 362051

Committed r241574: <https://trac.webkit.org/changeset/241574>
Comment 7 WebKit Commit Bot 2019-02-14 17:55:34 PST
All reviewed patches have been landed.  Closing bug.