WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
186202
[QuickLook] Add a test to ensure that a same-origin XHR for a non-existent QuickLook attachment is allowed
https://bugs.webkit.org/show_bug.cgi?id=186202
Summary
[QuickLook] Add a test to ensure that a same-origin XHR for a non-existent Qu...
Daniel Bates
Reported
2018-06-01 11:59:36 PDT
Add a test to ensure that a same-origin XHR for a non-existent QuickLook attachment is allowed. That is, it is not blocked by the CSP policy of the QuickLook sandbox.
Attachments
For EWS
(5.30 KB, patch)
2018-06-01 12:02 PDT
,
Daniel Bates
bfulgham
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2018-06-01 12:02:40 PDT
Created
attachment 341776
[details]
For EWS
Daniel Bates
Comment 2
2018-06-01 12:03:59 PDT
For convenience, here is the pretty-printed JavaScript URL embedded in the RTF included in the proposed patch (
attachment #341776
[details]
): javascript: (function() { function logMessageAndDone(message) { console.log(message); window.testRunner && window.testRunner.notifyDone(); }; var xhr = new XMLHttpRequest; xhr.onload = () => logMessageAndDone("PASS: XMLHttpRequest allowed."); xhr.onerror = () => logMessageAndDone("FAIL: XMLHttpRequest blocked."); xhr.open("GET", document.origin + "/x-apple-ql-magic/non-existent-quicklook-attachment.rtf"); xhr.send(); })();
youenn fablet
Comment 3
2018-06-04 08:42:11 PDT
***
Bug 186165
has been marked as a duplicate of this bug. ***
youenn fablet
Comment 4
2018-06-04 08:50:20 PDT
(In reply to youenn fablet from
comment #3
)
> ***
Bug 186165
has been marked as a duplicate of this bug. ***
Made a mistake there in marking as duplicate.
youenn fablet
Comment 5
2018-06-04 08:50:44 PDT
(In reply to Daniel Bates from
comment #0
)
> Add a test to ensure that a same-origin XHR for a non-existent QuickLook > attachment is allowed. That is, it is not blocked by the CSP policy of the > QuickLook sandbox.
I am not sure to understand. After
https://trac.webkit.org/changeset/231107
, we make this load fails. After discussion, it seems to me that we are ok with this change of behavior. If so, shouldn't we make the test to expect failure and rename it accordingly?
Daniel Bates
Comment 6
2018-06-04 09:41:21 PDT
(In reply to youenn fablet from
comment #5
)
> (In reply to Daniel Bates from
comment #0
) > > Add a test to ensure that a same-origin XHR for a non-existent QuickLook > > attachment is allowed. That is, it is not blocked by the CSP policy of the > > QuickLook sandbox. > > I am not sure to understand. > After
https://trac.webkit.org/changeset/231107
, we make this load fails. > After discussion, it seems to me that we are ok with this change of behavior. > If so, shouldn't we make the test to expect failure and rename it > accordingly?
I did not have the impression that blocking the load is an acceptable change of behavior.
Andy Estes
Comment 7
2018-06-04 16:42:45 PDT
(In reply to Daniel Bates from
comment #6
)
> (In reply to youenn fablet from
comment #5
) > > (In reply to Daniel Bates from
comment #0
) > > > Add a test to ensure that a same-origin XHR for a non-existent QuickLook > > > attachment is allowed. That is, it is not blocked by the CSP policy of the > > > QuickLook sandbox. > > > > I am not sure to understand. > > After
https://trac.webkit.org/changeset/231107
, we make this load fails. > > After discussion, it seems to me that we are ok with this change of behavior. > > If so, shouldn't we make the test to expect failure and rename it > > accordingly? > > I did not have the impression that blocking the load is an acceptable change > of behavior.
The intent of Quick Look converting invalid x-apple-ql-id: URLs to about: is to block the load, so I think this behavior change is acceptable, although ideally we'd retain the original behavior of successfully loading about:. It would be unacceptable if *valid* x-apple-ql-id: URLs were blocked, of course.
youenn fablet
Comment 8
2018-06-04 19:07:58 PDT
> The intent of Quick Look converting invalid x-apple-ql-id: URLs to about: is > to block the load, so I think this behavior change is acceptable, although > ideally we'd retain the original behavior of successfully loading about:.
I am not sure to see the benefit of keeping the original behavior. Isn't it better to stop failing silently if invalid x-apple-ql-id means a bug in the generation of these URLs?
youenn fablet
Comment 9
2018-06-06 08:55:21 PDT
> I am not sure to see the benefit of keeping the original behavior. > Isn't it better to stop failing silently if invalid x-apple-ql-id means a > bug in the generation of these URLs?
Instead of relying on CSP/CORS to fail the load, we could be cancelling the load in ResourceLoader with a comprehensive message when the request URL is converted to "about:".
Brent Fulgham
Comment 10
2018-06-29 16:38:01 PDT
Comment on
attachment 341776
[details]
For EWS r=me
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