返回资讯中心
外部精选
软件工程
#开发者实时流

Cookie expiry capping for CNAME cloaking should not apply to YouTube and Google

Cookie expiry capping for CNAME cloaking should not apply to YouTube and Google first parties - #78492

Hacker News 最新erikkri2026/10/30 · 18 天前30 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Code

Pull requests3.2k (3.2k)

Actions

Wiki

Security and quality

Insights

More items

Cookie expiry capping for CNAME cloaking should not apply to YouTube and Google first parties - #78492

#78492

Merged

webkit-commit-queue merged 1 commit intoWebKit:mainWebKit/WebKit:mainfrom igower:eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-partiesigower/WebKit:eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-partiesCopy head branch name to clipboard

Oct 29, 2026

ConversationCommits1 (1)ChecksFiles changed

Merged

Cookie expiry capping for CNAME cloaking should not apply to YouTube and Google first parties#78492

webkit-commit-queue merged 1 commit intoWebKit:mainWebKit/WebKit:mainfrom igower:eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-partiesigower/WebKit:eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-partiesCopy head branch name to clipboard

Conversation

igower

commented

Oct 27, 2026

•

edited by webkit-early-warning-system

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Contributor

a7d3aef

Cookie expiry capping for CNAME cloaking should not apply to YouTube and Google first parties https://bugs.webkit.org/show_bug.cgi?id=329139 rdar://191131755

Reviewed by Brent Fulgham.

accounts.youtube.com resolves through a CNAME to google.com, so the CNAME cloaking check caps the expiry of cookies it sets on youtube.com. That includes __Secure-1PSIDTS and __Secure-3PSIDTS, which Google issues with a one year lifetime and rotates. Once the capped cookie expires, the server treats the session as stale and deletes the YouTube session cookies. Therefore users are signed out of YouTube while their Google session stays intact.

Skip the CNAME check when both the first party and the CNAME target are youtube.com or google.com. A Google first party that resolves through a non-Google CNAME is still capped.

  • Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.mm: (WebKit::isGoogleOwnedSite): (WebKit::NetworkTaskCocoa::setCookieTransformForFirstPartyRequest):

Canonical link: https://commits.webkit.org/325161@main

e3ca659

There was an error while loading. Please reload this page.

igower

requested a review from cdumez as a code owner

October 27, 2026 19:07

igower

self-assigned this

Oct 27, 2026

igower

added the WebKit2

Bugs relating to the WebKit2 API layer label

Oct 27, 2026

webkit-early-warning-system

commented

Oct 27, 2026

•

edited

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Collaborator

EWS run on previous version of this PR (hash 747be63)

There was an error while loading. Please reload this page.

igower

force-pushed the

eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-parties

branch from 747be63 to 8d233ce Compare

October 27, 2026 20:58

webkit-early-warning-system

commented

Oct 27, 2026

•

edited

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Collaborator

EWS run on previous version of this PR (hash 8d233ce)

There was an error while loading. Please reload this page.

igower

force-pushed the

eng/Cookie-expiry-capping-for-CNAME-cloaking-should-not-apply-to-YouTube-and-Google-first-parties

branch from 8d233ce to e3ca659 Compare

October 27, 2026 21:40

webkit-early-warning-system

commented

Oct 27, 2026

•

edited

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Collaborator

EWS run on current version of this PR (hash e3ca659)

There was an error while loading. Please reload this page.

brentfulgham

reviewed

Oct 27, 2026

View reviewed changes

Comment thread

Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.mm

static bool isGoogleOwnedSite(const String& registrableDomainName)

{

return registrableDomainName == "youtube.com"_s || registrableDomainName == "google.com"_s;

brentfulgham

Oct 27, 2026

Copy link

Copy Markdown

Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can this be reused anywhere? I feel like there are other cases where we treat these as identical.

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Contributor

Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The only other place I found that pairs these is the IP-address quirk lambda a few lines up, and it isn't quite the same. It exempts google.com for any request, and google.* / youtube.com only for consent.* hosts. Reusing isGoogleOwnedSite there would widen the IP exemption to youtube.com requests.

I couldn't find a case where the YouTube IP cap causes a sign-out, and I don't know if we should change it without one.

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Out of curiosity, isn't this against WebKit's Tracking Prevention Policy, particularly the "No Exceptions" section? 🤔

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It is not. This is about third-party cloaking. A main frame first party domain cloaked to another main frame first party domain from the same party is not third-party cloaking. You may not be familiar with this specific code, but its intent is to limit the capabilities of cloaking third parties as first parties. Note that cloaking is not related to cookie blocking.

There was an error while loading. Please reload this page.

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I understand the CNAME cloaking protection aspect against trackers etc.

But this gives Google a clear advantage in terms of keeping users signed in to their services.

And alot of websites are using e.g. CloudFront in front of services, and CNAME is often used in that case.

Also ref. this comment as well, in regards to caping towards IP addresses: #5347 (comment)

And why just Google and their services? I'd imagine this is being added because it's an issue for them keeping their users signed in over a longer period? They aren't the only ones on the internet using this type account / login solution.

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Is CloudFront a main frame first party domain from the same party as the websites you're referring to?

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No, but other websites and services using CloudFront as a provider. And websites that don't own their entire cloud infrastructure.

My point is that this seems to be picking "winners" and "losers" on the web. Google now has an easier and more resilient way to keep users signed in compared to non-Google websites.

There was an error while loading. Please reload this page.

Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link

Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

And this seems to be the case for more parts of this code, by giving Google an exemption from the default logic:

0966c69

There was an error while loading. Please reload this page.

brentfulgham

requested review from charliewolfe, johnwilander and sysrqb

October 27, 2026 23:18

brentfulgham

approved these changes

Oct 28, 2026

View reviewed changes

brentfulgham

left a comment

Copy link

Copy Markdown

Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

There was an error while loading. Please reload this page.

igower

added

safe-merge-queue

Applied to automatically send a pull-request to merge-queue after passing EWS checks

unsafe-merge-queue

Applied to send a pull request to merge-queue, but skip building and testing

and removed

safe-merge-queue

Applied to automatically send a pull-request to merge-queue after passing EWS checks

labels

Oct 28, 2026

Cookie expiry capping for CNAME cloaking should not apply to YouTube …

…

a7d3aef

…and Google first parties

https://bugs.webkit.org/show_bug.cgi?id=329139 rdar://191131755

Reviewed by Brent Fulgham.

accounts.youtube.com resolves through a CNAME to google.com, so the CNAME cloaking check caps the expiry of cookies it sets on youtube.com. That includes __Secure-1PSIDTS and __Secure-3PSIDTS, which Google issues with a one year lifetime and rotates. Once the capped cookie expires, the server treats the session as stale and deletes the YouTube session cookies. Therefore users are signed out of YouTube while their Google session stays intact.

Skip the CNAME check when both the first party and the CNAME target are youtube.com or google.com. A Google first party that resolves through a non-Google CNAME is still capped.

  • Source/WebKit/NetworkProcess/cocoa/NetworkTaskCocoa.mm: (WebKit::isGoogleOwnedSite): (WebKit:

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →