Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google cookie persisting despite "Forget Me When I Close This Site" being enabled by default #42798

Open
3 of 6 tasks
Saoiray opened this issue Dec 10, 2024 · 11 comments · May be fixed by brave/brave-core#27042
Open
3 of 6 tasks

Comments

@Saoiray
Copy link

Saoiray commented Dec 10, 2024

Description

A Google cookie is appearing and persisting in the profile despite not visiting Google. The "Forget Me When I Close This Site" setting is enabled by default, which should clear all cookies upon exiting Brave, but the Google cookie remains.

Steps to reproduce

  1. Create a new profile
  2. Enable Forget Me When I Close This Site as the default global option
  3. Set to open on new tab page
  4. Visit Reddit.com
  5. Check brave://settings/content/all and you'll see it show reddit.com and google.com
  6. Exit Brave
  7. Open Brave and see that reddit.com is cleared but google.com remains.

Actual result

The Google cookie remains listed and does not get cleared.

Expected result

Google cookies should not appear if Google is not visited. If they do appear, they should be cleared when Brave is closed due to the "Forget Me When I Close This Site" setting.

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave | 1.73.97 Chromium: 131.0.6778.108 (Official Build) (64-bit) -- | -- Revision | 7e1cc6e3239d93ac39456640abb6b6f8bc51fd39 OS | Windows 11 Version 24H2 (Build 26100.2454) Brave | 1.74.20 Chromium: 131.0.6778.108 (Official Build) beta (64-bit) -- | -- Revision | 6f52e170fb1611fc69347fb24bca600ed052f7b3 OS | Windows 11 Version 24H2 (Build 26100.2454) Brave | 1.75.86 Chromium: 132.0.6834.33 (Official Build) nightly (64-bit) -- | -- Revision | 0e6fd65d499de588288c231ca0aba711876f5022 OS | Windows 11 Version 24H2 (Build 26100.2454)

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

Video of this happening can be seen at https://youtu.be/RC4PYPM83aY

In that, I imitated what I did first time, which is visiting facebook, x, and reddit. But found it's primarily happening with Reddit. Though not sure where else it might find its way in.

cc: @Brave-Matt and @ryanbr

Image

@Brave-Matt
Copy link

Brave-Matt commented Dec 10, 2024

@ShivanKaul
Copy link
Collaborator

ShivanKaul commented Dec 12, 2024

@Saoiray if you close reddit.com manually and wait for 30 seconds BEFORE quitting the browser, does that clear all the cookies? If you quit the browser before closing the site, that wouldn't trigger "forget me when I close this site."

@Saoiray
Copy link
Author

Saoiray commented Dec 12, 2024

@ShivanKaul that's a negative. This little google.com entry still appears and persists. And while I call it a cookie, I'm not sure if it is or if it's something else. If you'd like, can schedule a time with you and do a screenshare or whatever. Might be easier to get data or test.

@Saoiray
Copy link
Author

Saoiray commented Dec 12, 2024

I also want to highlight I can replicate in all release channels. In trying to rule things out, I even purged all profiles on Beta and started fresh. Then I was able to go through everything as indicated originally, where everything clears out except the google entry.

Image

Part of me wondered if might have been because of search engine or something, but default settings are to Brave Search.

Image

When trying to delete it, get the normal prompt saying might get signed out and all.

Image

-NOTE-

If I go to Delete Browsing Data it will erase the entry. So this exception only seems to be happening via the Forget me when I close this site.

At around 100 B it's not much data at all, but not sure if it's just enough of something inserted to track or if it's something else. Or what it's falling under that doesn't get cleared that way.

@Saoiray
Copy link
Author

Saoiray commented Dec 12, 2024

Sorry, but one more update. I just pulled out my old Samsung Galaxy S9 (Android 10) and installed Brave Beta (1.74.20) on it. I tried the same thing, enabling Forget me when I close this site and then visiting Reddit.com.

Traveling to Brave's settings -> Site Settings -> All Sites showed reddit.com (7 cookies, 7.5 kB) and google.com (133 B), though I never visited Google.

From there I hit the back button until I got back to where Reddit was open and I closed the tab. Stared at the You'll find your tabs here thing for more than 30 seconds before opening Settings. I went back to the All Sites as indicated before and the only thing listed was www.google.com (133 B).

@goodov
Copy link
Member

goodov commented Dec 16, 2024

Reddit enables DisableThirdPartyStoragePartitioning2 [1] origin trial for google.com. This makes google.com iframe store its data without partitioning. Our cleanup logic removes top frame storage and partitioned storage keyed by the top frame origin, so technically nothing is broken.

We may prevent this trial to be enabled, but it potentially may break some things. @ShivanKaul thoughts?

Decrypted origin trial from reddit:

{
  "payload": {
    "origin": "https://google.com:443",
    "feature": "DisableThirdPartyStoragePartitioning2",
    "expiry": 1742342399,
    "isSubdomain": true,
    "isThirdParty": true
  },
...

This can also be seen in devtools:
Image

  1. https://developer.chrome.com/origintrials/#/view_trial/568016503002103809

@ShivanKaul
Copy link
Collaborator

Can we confirm that disabling the upstream origin trial fixes the issue i.e. the 3rd party Google cookie is stored in the partition, and is cleared when forgetful browsing is invoked?

@goodov
Copy link
Member

goodov commented Dec 16, 2024

Can we confirm that disabling the upstream origin trial fixes the issue i.e. the 3rd party Google cookie is stored in the partition, and is cleared when forgetful browsing is invoked?

yes, confirmed an ignored origin trial partitions google.com:
Image

after 30 seconds cleanup:
Image

@ShivanKaul
Copy link
Collaborator

Thanks for confirming. I think we should disable this origin trial. Websites shouldn't be able to unilaterally opt-out of Brave's privacy protections, especially something as fundamental as storage partitioning.
cc @arthuredelstein

@arthuredelstein
Copy link

Will disabling this origin trial break reddit or any other websites? I agree we don't want to have this opt-out, but it would be good to know what the consequences will be and if we can mitigate any problems.

@goodov
Copy link
Member

goodov commented Dec 17, 2024

I guess ideally we should bind the origin trial disabling to Brave Shields on/off state, but not sure if it's easy doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

7 participants