TheFantasticWarrior / chrome-extension-imagus

"Mirror" of the "Mirror" of the official Imagus source hosted on Google Drive. currently taking a break on this project
https://addons.mozilla.org/en-US/firefox/addon/imagus-mod/
220 stars 7 forks source link

Cookies leak outside of private browsing #50

Open Rob--W opened 1 year ago

Rob--W commented 1 year ago

(This privacy issue was originally reported at https://bugzilla.mozilla.org/show_bug.cgi?id=1833842)

The extension calls fetch() from the background page:

https://github.com/TheFantasticWarrior/chrome-extension-imagus/blob/24072e8c4d40f871ed30bbf3215c02412fbcbdad/src/js/app_bg.js#L224-L226 https://github.com/TheFantasticWarrior/chrome-extension-imagus/blob/24072e8c4d40f871ed30bbf3215c02412fbcbdad/src/js/app_bg.js#L178-L180

This fetch call runs in the context of the extension's background page, usually the non-private browsing mode. The problem with this logic is that if the server responds with any cookies, that it is associated with the default browsing mode. This can result in privacy issues in the following situations:

To resolve this issue, I recommend to pass the two additional flags to the fetch call:

credentials: "omit",
cache: "no-store",

An alternative (in Firefox, as long as the extension is Manifest Version 2) is to call fetch from the content script. Then it will automatically be associated with the right cookie store.