Cookies set in normal window show up in cookies in devtools within Private Mode
Categories
(DevTools :: General, defect, P2)
Tracking
(Not tracked)
People
(Reporter: kontakt, Unassigned)
References
Details
Attachments
(1 file)
479.79 KB,
video/webm
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0
Steps to reproduce:
Open two windows - one regular, one in private mode. Go to mozilla.org in both of them. Open Devtools in both of them, navigate to Storage. In regular mode, run document.cookie="leaks=true"
. Navigate to Private Mode, open the mozilla.org tree in cookies view, see that this cookie is visible there, as well.
Actual results:
The "leaks=true" cookie is visible in the devtools in the Private Mode window
Expected results:
It should be separate, cookies set in regular windows should not leak to private windows
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
This also happens across Firefox Containers
Comment 3•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::General' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•2 years ago
|
||
The exact STRs seem to be:
- open a tab in a regular Firefox window
- open the same tab in a Private Browsing Firefox window
- open the storage inspector in the Private Browsing Firefox window
- run
document.cookie="leaks=true"
in the regular Firefox window
You will see the cookie appear in the Storage inspector of the Private Browsing Firefox window. However the cookie is not actually set. If you close/reopen devtools, the leaks
cookie is gone. And using document.cookie to read cookies will also not show this cookie.
So this is most likely only a UI bug where we incorrectly show the cookie in the UI and not an actual leak of the cookie between regular and private windows.
Updated•2 years ago
|
Updated•1 year ago
|
Comment 7•9 months ago
•
|
||
I suspect it's an issue with how we listen for cookie changes. I see that devtool subscribes to both normal and private browsing cookie changes here: https://searchfox.org/mozilla-central/rev/3966e5534ddf922b186af4777051d579fd052bad/devtools/server/actors/resources/storage/cookies.js#528
It then calls onCookieChanged
here: https://searchfox.org/mozilla-central/rev/3966e5534ddf922b186af4777051d579fd052bad/devtools/server/actors/resources/storage/cookies.js#201
but doesn't do any filtering for normal or private browsing as far as I can see? Really it should look at the cookie's OriginAttributes and compare them to the OriginAttributes of the principal of the content window the devtools instance is attached to.
Description
•