Closed
Bug 1158208
Opened 10 years ago
Closed 9 years ago
Enforce that tiles HTTP requests don't have cookies
Categories
(Firefox :: New Tab Page, defect)
Firefox
New Tab Page
Tracking
()
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: benjamin, Assigned: Mardak)
References
Details
(Whiteboard: .?)
Attachments
(2 files, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
adw
:
review+
|
Details | Diff | Splinter Review |
Currently tiles makes the following HTTP(s) requests:
* requesting the source JSON document
* requesting the tile images
* sending the data JSON ping
Right now we promise that the servers will not set cookies for each of these requests. We should enforce on the client that we don't ever send cookies with these requests. I believe that we have a way to do this already, but I don't remember/can't find the details.
Reporter | ||
Comment 1•10 years ago
|
||
Just found XHR.mozAnon, which is what we should be using.
Assignee | ||
Updated•10 years ago
|
Whiteboard: .?
Assignee | ||
Updated•9 years ago
|
Component: Tiles → New Tab Page
Product: Content Services → Firefox
Assignee | ||
Comment 2•9 years ago
|
||
Some reason it looks like the internal interface doesn't allow parameters but the webidl interface does:
http://mxr.mozilla.org/mozilla-central/source/dom/base/nsXMLHttpRequest.h#208
So to get the appropriate constructor, I grabbed XHR from the hidden window.
Assignee | ||
Updated•9 years ago
|
Attachment #8604386 -
Attachment description: bug1158208.patch → v1
Assignee | ||
Comment 3•9 years ago
|
||
Update docs
Attachment #8604386 -
Attachment is obsolete: true
Attachment #8604386 -
Flags: review?(adw)
Attachment #8604387 -
Flags: review?(adw)
Comment 4•9 years ago
|
||
Comment on attachment 8604387 [details] [diff] [review]
v1.1
Review of attachment 8604387 [details] [diff] [review]:
-----------------------------------------------------------------
There may be a "more correct" way to do this using nsIRequest/nsIChannel and load flags like LOAD_ANONYMOUS (which I bet is what this XHR mozAnon boils down to), but this is fine with me.
::: browser/modules/DirectoryLinksProvider.jsm
@@ +347,5 @@
> /**
> + * Create a new XMLHttpRequest that is anonymous, i.e., doesn't send cookies
> + */
> + _newXHR() {
> + // Use XHR with WebIDL that accepts extra parameters
Could you please make it more clear that only the WebIDL XHR appears to support mozAnon?
Attachment #8604387 -
Flags: review?(adw) → review+
Assignee | ||
Comment 5•9 years ago
|
||
Meh. My hack isn't super useful because... there's no hidden window from xpcshell tests! ;)
Perhaps I can try/catch hidden window and fall back to createInstance. xpcshell test won't pass mozAnon == true but mochitest should....
Assignee | ||
Comment 6•9 years ago
|
||
Just to attach this for now..
Attachment #8604387 -
Attachment is obsolete: true
Assignee | ||
Comment 7•9 years ago
|
||
This depends on bug 1163898, which will probably be difficult to uplift to 40/39, so perhaps we'll just ride the trains on this functionality in 41.
Attachment #8604771 -
Flags: review?(adw)
Comment 8•9 years ago
|
||
Comment on attachment 8604771 [details] [diff] [review]
v2 depends on bug 1163898
Review of attachment 8604771 [details] [diff] [review]:
-----------------------------------------------------------------
You could do both and uplift the hidden window one. The test coverage isn't really buying much anyway.
Attachment #8604771 -
Flags: review?(adw) → review+
Assignee | ||
Comment 10•9 years ago
|
||
To be clear, it's not entirely straightforward to just use hidden window fix because various xpcshell tests rely on XHR object existing (not just the newly added test-anonymous), but trying to access hiddenwindow.XHR throws.
Iteration: --- → 41.1 - May 25
Points: --- → 3
Assignee | ||
Comment 11•9 years ago
|
||
ni? per https://wiki.mozilla.org/Firefox/Data_Collection
(In reply to Pulsebot from comment #9)
> https://hg.mozilla.org/integration/mozilla-inbound/rev/cca3ce6947c2
No additional data is being collected. Firefox is adding an extra no-cookie safeguard, so updating .rst.
Flags: needinfo?(benjamin)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
You need to log in
before you can comment on or make changes to this bug.
Description
•