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

add cookie exceptions so *.google.com <=> *.googleapis.com #5313

Closed
wants to merge 1 commit into from

Conversation

pes10k
Copy link
Contributor

@pes10k pes10k commented Apr 22, 2020

Adds several storage allowances, so that google.com can set cookies for googleapis.com, and vise versa. Note that additional exceptions are needed so that [*.].google.com can set cookies on [*.].google.com because of subdomain / eTLD+1 issues in how content setting rules are applied.

Second half of whats needed to fix brave/brave-browser#1122

@pes10k
Copy link
Contributor Author

pes10k commented Apr 22, 2020

Note that there is not an automated test for this included, because the issue is addresses very complex interactions between multiple google properties and cookie settings. Would be best handled with manual QA

@bridiver bridiver requested a review from jumde April 22, 2020 15:59
@pes10k pes10k force-pushed the fix-google-drive-autoplay branch from 5f7d4c7 to b62a7c6 Compare April 22, 2020 16:35
for (const auto &outer : patterns) {
for (const auto &inner : patterns) {
const auto a_rule = Rule(
outer,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds an exception for allowing cookies from https://[*.]googleapis.com/* to https://[*.]googleapis.com/* - Why do we need that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, i dont fully understand why the same domain rules were needed. making the exception for [*.]google.com to [*.]google.com seemed like it shouldn't have been needed (same with the above).

We can remove the above, i don't think it'll be a big deal. It just makes the thing a bit more clumsy to express. If you'd prefer to just have the three exceptions though:

[*.]google.com -> [*.]google.com
[*.]google.com -> [*.]googleapis.com
[*.]googleapis.com -> [*.]google.com

I can update accordingly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these two exceptions resolve the issue:

[*.]google.com -> [*.]googleapis.com
[*.]googleapis.com -> [*.]google.com

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From discussion with @pes10k:

there were cookies that wouldn’t be sent from (deeply nested sub domains).drive.google.com to drive.google.com

@iefremov @bridiver - This looks like a separate issue being fixed by [*.]google.com -> [*.]google.com exception. Any thoughts why this might be happening?

More details here: https://bravesoftware.slack.com/archives/C2FQMN4AD/p1587530010205900?thread_ts=1586811883.160700&cid=C2FQMN4AD

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jumde correct, we should only need to handle googleapis.com <-> google.com

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[*.]google.com -> [*.]google.com should already be fine unless you have a site exception added for blocking 3rd-party cookies (toggled to a different setting and then back again)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may have to do with the other 3p cookie issues uncovered and discussed today, but i can promise that this was needed to unbreak the site, and that *.google.com domains were not sending cookies to other *.google.com w/o it as of last night

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've retested this after #5318 and cherry picking in #5341, and the [*.]google.com -> [*.]google.com exception is still needed.

@bridiver whatever is going is going on at a level of chromium / brave-core that I dont understand or can dig into anytime soon. What do you think if I create a follow up issue (assigned to you?) to investigate further, and add a similar todo / ¯\_(ツ)_/¯ comment in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bc it would be good to get this fix out ASAP

@bridiver bridiver force-pushed the fix-google-drive-autoplay branch from b62a7c6 to 766725e Compare April 27, 2020 17:23
@bridiver
Copy link
Collaborator

bridiver commented May 6, 2020

closed in favor of #5433

@bridiver bridiver closed this May 6, 2020
@pes10k pes10k deleted the fix-google-drive-autoplay branch June 10, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Drive does not play mp4 video
3 participants