WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
199074
Storage Access API: Cap the number of times an iframe document can request access
https://bugs.webkit.org/show_bug.cgi?id=199074
Summary
Storage Access API: Cap the number of times an iframe document can request ac...
John Wilander
Reported
2019-06-20 11:32:01 PDT
We hoped that iframes that request storage access would count the number of times the user has been asked and not repeat the request over and over. However, we're seeing pretty aggressive use of the API and users are complaining. Therefore, we should implement a cap on how many times an iframed document can ask if it is explicitly denied access by the user. This is a first measure. If we see continued aggressive use of the API, we'll have to consider more drastic measures.
Attachments
Patch
(4.20 KB, patch)
2019-06-20 11:46 PDT
,
John Wilander
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
John Wilander
Comment 1
2019-06-20 11:32:28 PDT
<
rdar://problem/51857195
>
John Wilander
Comment 2
2019-06-20 11:46:57 PDT
Created
attachment 372576
[details]
Patch
Brent Fulgham
Comment 3
2019-06-20 12:00:45 PDT
Comment on
attachment 372576
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=372576&action=review
> Source/WebCore/dom/DocumentStorageAccess.h:69 > + void setWasExplicitlyDeniedFrameSpecificStorageAccess() { ++m_numberOfTimesExplicitlyDeniedFrameSpecificStorageAccess; };
This seems to increment count for all frames. So, if a page embedded a frame from 'social.com', a second from 'video.com', and a third from 'music.com', the 'music.com' site might get blocked even though each frame had only asked for permission once. Is that a problem? I'm trying to remember if storage access is gated on the user interacting with the frame. Are we hitting these multiple requests when just loading the page? Would it be better to perform the counting at the {document, frame} pair, instead of just all access requests of any kind incrementing a single top-level document counter?
John Wilander
Comment 4
2019-06-20 12:05:22 PDT
(In reply to Brent Fulgham from
comment #3
)
> Comment on
attachment 372576
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=372576&action=review
> > > Source/WebCore/dom/DocumentStorageAccess.h:69 > > + void setWasExplicitlyDeniedFrameSpecificStorageAccess() { ++m_numberOfTimesExplicitlyDeniedFrameSpecificStorageAccess; }; > > This seems to increment count for all frames. So, if a page embedded a frame > from 'social.com', a second from 'video.com', and a third from 'music.com', > the 'music.com' site might get blocked even though each frame had only asked > for permission once.
I don't think that's the case. The DocumentStorageAccess class supplements Document and has a reference to the document it belongs to. So the count should be for this document in the iframe. I tried to express this scope in the bug title and explanation.
> Is that a problem? > > I'm trying to remember if storage access is gated on the user interacting > with the frame. Are we hitting these multiple requests when just loading the > page?
The user has to interact with the iframe. The problem is that these iframes just keep asking if the user says "Don't Allow." Being able to prompt a second time makes sense since the user might not be happy with the result of choosing "Don't Allow." But after two explicit rejections, the iframe should back off.
> Would it be better to perform the counting at the {document, frame} pair, > instead of just all access requests of any kind incrementing a single > top-level document counter?
See above.
Brent Fulgham
Comment 5
2019-06-20 12:08:21 PDT
Comment on
attachment 372576
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=372576&action=review
r=me
>>> Source/WebCore/dom/DocumentStorageAccess.h:69 >>> + void setWasExplicitlyDeniedFrameSpecificStorageAccess() { ++m_numberOfTimesExplicitlyDeniedFrameSpecificStorageAccess; }; >> >> This seems to increment count for all frames. So, if a page embedded a frame from 'social.com', a second from 'video.com', and a third from 'music.com', the 'music.com' site might get blocked even though each frame had only asked for permission once. >> >> Is that a problem? >> >> I'm trying to remember if storage access is gated on the user interacting with the frame. Are we hitting these multiple requests when just loading the page? >> >> Would it be better to perform the counting at the {document, frame} pair, instead of just all access requests of any kind incrementing a single top-level document counter? > > I don't think that's the case. The DocumentStorageAccess class supplements Document and has a reference to the document it belongs to. So the count should be for this document in the iframe. I tried to express this scope in the bug title and explanation.
Ah! Understood. The Document here is the frame's document, not the overall top-level document. This is a good change. r=me.
John Wilander
Comment 6
2019-06-20 12:10:12 PDT
(In reply to Brent Fulgham from
comment #5
)
> Comment on
attachment 372576
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=372576&action=review
> > r=me > > >>> Source/WebCore/dom/DocumentStorageAccess.h:69 > >>> + void setWasExplicitlyDeniedFrameSpecificStorageAccess() { ++m_numberOfTimesExplicitlyDeniedFrameSpecificStorageAccess; }; > >> > >> This seems to increment count for all frames. So, if a page embedded a frame from 'social.com', a second from 'video.com', and a third from 'music.com', the 'music.com' site might get blocked even though each frame had only asked for permission once. > >> > >> Is that a problem? > >> > >> I'm trying to remember if storage access is gated on the user interacting with the frame. Are we hitting these multiple requests when just loading the page? > >> > >> Would it be better to perform the counting at the {document, frame} pair, instead of just all access requests of any kind incrementing a single top-level document counter? > > > > I don't think that's the case. The DocumentStorageAccess class supplements Document and has a reference to the document it belongs to. So the count should be for this document in the iframe. I tried to express this scope in the bug title and explanation. > > Ah! Understood. The Document here is the frame's document, not the overall > top-level document. > > This is a good change. r=me.
I just tested to make sure, and it is scoped to the iframed document. Thanks for the review!
WebKit Commit Bot
Comment 7
2019-06-20 13:04:04 PDT
Comment on
attachment 372576
[details]
Patch Clearing flags on attachment: 372576 Committed
r246647
: <
https://trac.webkit.org/changeset/246647
>
WebKit Commit Bot
Comment 8
2019-06-20 13:04:05 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