`InstallTrigger` and `mozAddonManager` leaking cookies in private browsing mode
Categories
(Toolkit :: Add-ons Manager, defect, P1)
Tracking
()
People
(Reporter: TheOne, Assigned: Gijs)
Details
(Keywords: privacy, sec-low, Whiteboard: [fingerprinting][post-critsmash-triage][adv-main68+])
Attachments
(4 files, 1 obsolete file)
In private browsing mode, websites that call InstallTrigger
to trigger the install of a download leak cookies that were set outside of private browsing mode in the request to fetch the add-on file.
The same counts for AMO, that is using mozAddonManager
: When installing an add-on from AMO in private browsing mode, the non-private browsing cookies from AMO are included in the request to fetch the file.
exemplary STR for AMO:
- Open AMO in non-private browsing mode
- Open the devtools and make note of the "sessionid" cookie for requests.
- Clear your cache (important!)
- Open AMO in private browsing mode.
- In the web console, execute:
navigator.mozAddonManager.createInstall({ url: "https://addons.mozilla.org/firefox/downloads/file/1672871/ublock_origin-1.18.4-an+fx.xpi", hash: "sha256:b7aa57bd91943a2d3dd3621872e8700b2f59665db5c92fc54bca5049780cc91c" }).then((install) => { install.install(); })
(This is pretty much what clicking on the "Add to Firefox" button would do).
- In the network panel, inspect the request to get that file and check the cookies. The "sessionid" cookie should be identical to the one in (2).
Assignee | ||
Comment 1•6 years ago
|
||
Is this a regression? I can confirm beta is affected; have you tried release?
Assignee | ||
Comment 2•6 years ago
|
||
I vaguely recall we tried to do something like this before, but we didn't go through with it. I suspect it's because we didn't serialize principals sent from JS at the time (we do now, bug 1515863 fixed in 66 and later), though I could be wrong. Anyway, this code seems to work for me (only tried with the example in comment #0, haven't tried InstallTrigger, haven't run any tests, etc.).
Dumb idea? Am I missing anything?
(Christoph, do these flags for the actual channel look approximately right?)
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Reporter | ||
Comment 5•6 years ago
|
||
(In reply to :Gijs (he/him) from comment #1)
Is this a regression? I can confirm beta is affected; have you tried release?
I can reproduce this in 65.0.1.
Comment 6•6 years ago
|
||
Not too worried about mozAddonManager since it's only available to our own sites, but this means InstallTrigger() could be used as a sneaky tracking mechanism. Would be noisy though since by default users will get a prompt that a site it trying an install before we send anything.
Assignee | ||
Comment 7•6 years ago
|
||
There's no way I'm getting to polishing this up, writing tests, getting review, and uplift to 66, in the next week or so. Too much other stuff. Marking wontfix for 66 given that, and the fact that this is sec-low.
Updated•6 years ago
|
Assignee | ||
Comment 8•6 years ago
|
||
I expect this has just always been broken...
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
Depends on D25774
Assignee | ||
Comment 11•6 years ago
|
||
Landed as:
https://hg.mozilla.org/integration/autoland/rev/acce10271d62
https://hg.mozilla.org/integration/autoland/rev/fd9468269591
backed out as
https://hg.mozilla.org/integration/autoland/rev/182738789fa9
"for test_ext_privacy_update.js failures CLOSED TREE"
Assignee | ||
Comment 12•6 years ago
|
||
Turns out AddonManager.getInstallForURL / XPIInstall.getInstallForURL is used a lot, and requiring principals there doesn't seem like a good fix... poking at this some more.
Assignee | ||
Comment 13•6 years ago
|
||
Andrew figured out the leaks \o/
Landing this patchset with the test disabled on debug for now:
Comment 14•6 years ago
|
||
https://hg.mozilla.org/integration/autoland/rev/ee208901e86a56aedd617948d652b1134a72824c
https://hg.mozilla.org/integration/autoland/rev/c032b60a872e3946caa7308f120b91ed477103b9
https://hg.mozilla.org/mozilla-central/rev/ee208901e86a
https://hg.mozilla.org/mozilla-central/rev/c032b60a872e
Updated•6 years ago
|
Hi Gijs, since 67 is affected, do you want to uplift this fix to Beta67? Thanks!
Assignee | ||
Comment 16•6 years ago
|
||
I'm not 100% sure about uplifting... Andrew, thoughts?
Comment 17•6 years ago
|
||
Its a tough call. I trust the patch and we have pretty thorough existing tests to catch other regressions it might cause. But the patch touches a decent amount of code and this is a sec-low which makes me lean toward "no".
Assignee | ||
Comment 18•6 years ago
|
||
Alright, let's call it.
Updated•6 years ago
|
Comment 19•6 years ago
|
||
Could you please provide more details from where exactly I should get the "sessionid" from?
I tried to compare the "amo-request-id" from headers tab and the "id" from Cookies tab but there was no match, but I might be looking in the wrong direction.
Thanks.
Reporter | ||
Comment 20•6 years ago
|
||
The sessionid
cookie is set by addons.mozilla.org (AMO). Just browse any AMO page.
Comment 21•6 years ago
|
||
I didn't find any cookies of the requests in the private browsing mode.
After executing the script in the web console using private mode, I didn't find the request of adding "Ublock" in network panel, I even went through all the request and I the cookies panel was empty for all the request.
I'm not sure what I'm not doing wrong. I attached a screenshot of the cookies section for non-private browsing mode.
Reporter | ||
Comment 23•6 years ago
|
||
Also, you might have to log in into AMO.
Assignee | ||
Comment 24•6 years ago
|
||
Hani: for checking the request for ublock, you probably want the network panel in the browser toolbox, not the "normal" developer tools. See https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox .
Comment 25•6 years ago
|
||
In the screenshot attached is displayed the only "sessionid" displayed in private browsing mode and the sessionid is not matching the sessionid when using the non-private mode. Cookies panel for Ublock request is displayed empty.
Assignee | ||
Comment 26•6 years ago
|
||
Andreas, can you verify this please, as you reported? Seems the simplest. Thanks.
Reporter | ||
Comment 27•6 years ago
|
||
Tested and verified on Nightly (20190515092556).
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•4 years ago
|
Description
•