Skip to content

Add TAO destination check for navigation redirect chains#1931

Merged
annevk merged 6 commits into
mainfrom
navigation_tao_destination
Jun 25, 2026
Merged

Add TAO destination check for navigation redirect chains#1931
annevk merged 6 commits into
mainfrom
navigation_tao_destination

Conversation

@yoavweiss

@yoavweiss yoavweiss commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

As part of the WebPerfWG discussion on re-exposing redirectCount for opted-in cross-origin redirects, we discussed the fact that TAO currently only opts-in "backwards" in terms of origins, and doesn't constitute an opt-in to the destination origin, which is the appropriate opt-in for navigations (contrary to subresources).

This PR adds the mechanisms that can enable such "forward" opt-in, and can enable a response to a redirect chain to know that the redirect chain opted in to expose the redirects to its origin.

Once this lands, we'd use the relevant algorithms in the related HTML PR.

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

@yoavweiss yoavweiss marked this pull request as draft June 5, 2026 08:26
@yoavweiss yoavweiss marked this pull request as ready for review June 5, 2026 08:41
@yoavweiss yoavweiss requested a review from annevk June 5, 2026 08:50
@noamr

noamr commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Chrome team is supportive.

@noamr noamr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be simpler to keep a list of TAO value sets and iterate over them when computing the "navigation TAO check"?

@yoavweiss

Copy link
Copy Markdown
Collaborator Author

Wouldn't it be simpler to keep a list of TAO value sets and iterate over them when computing the "navigation TAO check"?

@annevk made a similar comment earlier on.

What we can do is something like:

  • We need the end response of the chain to have a list of lists of all the TAO values each response seen. We can get that by adding the a list of lists of past values to the redirect request and then move it to the response.
  • Navigation TAO check would verify that the TAO values of each response contain "*" or destination origin, otherwise it'd fail.

I don't know that it's simpler (and it seems like we'd be copying more values around between redirect responses), but happy to move to that model if that's simpler/easier

@noamr

noamr commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Wouldn't it be simpler to keep a list of TAO value sets and iterate over them when computing the "navigation TAO check"?

@annevk made a similar comment earlier on.

What we can do is something like:

  • We need the end response of the chain to have a list of lists of all the TAO values each response seen. We can get that by adding the a list of lists of past values to the redirect request and then move it to the response.
  • Navigation TAO check would verify that the TAO values of each response contain "*" or destination origin, otherwise it'd fail.

I don't know that it's simpler (and it seems like we'd be copying more values around between redirect responses), but happy to move to that model if that's simpler/easier

It's simpler to read (IMO) and potentially cleaner impl wise as there is no set manipulation as you go along and it's not a dedup check for each redirect.

@yoavweiss yoavweiss requested a review from noamr June 17, 2026 13:31

@noamr noamr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (though needs the checkboxes etc)

@yoavweiss

Copy link
Copy Markdown
Collaborator Author

@annevk - Can you take a look? Do I need to file a WebKit position on this, or will you be able to state support here?

yoavweiss added a commit to yoavweiss/WebKit that referenced this pull request Jun 21, 2026
…stination origin.

https://bugs.webkit.org/show_bug.cgi?id=316647

Reviewed by NOBODY (OOPS!).

This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513,
and ensures that TAO opt-ins for navigation timing take the destination origin into account.

Tests: imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-destination.tentative.html
       imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-partial.tentative.html
       imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-destination.tentative.html
       imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-no-referrer.tentative.html
       imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-other-origin.tentative.html
       imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-wildcard.tentative.html

* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-destination.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-destination.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-partial.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-chain-tao-partial.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-destination.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-destination.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-no-referrer.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-no-referrer.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-other-origin.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-other-origin.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-wildcard.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-xserver-tao-wildcard.tentative.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/resources/redirect-tao.py: Added.
(main):
* Source/WebCore/page/PerformanceNavigationTiming.cpp:
(WebCore::PerformanceNavigationTiming::redirectCount const):
* Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::appendToNavigationTimingAllowCheckList):
(WebKit::NetworkLoadChecker::passesNavigationTAOCheck const):
(WebKit::NetworkLoadChecker::shouldExposeNavigationRedirectTiming):
* Source/WebKit/NetworkProcess/NetworkLoadChecker.h:
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 23, 2026
This CL implements whatwg/html#12513 and
whatwg/fetch#1931, in order to resolve
w3c/navigation-timing#215.

It enables developers to opt-in to get cross-origin redirect timings,
through destination-based Timing-Allow-Origin headers.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ

Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101
Bug: 521861828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892
Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org>
Reviewed-by: Noam Rosenthal <nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1650808}
brave-builds pushed a commit to brave/chromium that referenced this pull request Jun 23, 2026
This CL implements whatwg/html#12513 and
whatwg/fetch#1931, in order to resolve
w3c/navigation-timing#215.

It enables developers to opt-in to get cross-origin redirect timings,
through destination-based Timing-Allow-Origin headers.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ

Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101
Bug: 521861828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892
Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org>
Reviewed-by: Noam Rosenthal <nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1650808}

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This design seemed reasonable to @achristensen07 and I so you can consider WebKit supportive.

Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
@Bas-moz

Bas-moz commented Jun 24, 2026

Copy link
Copy Markdown

This looks good from the Mozilla side as well.

jcscottiii pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 24, 2026
This CL implements whatwg/html#12513 and
whatwg/fetch#1931, in order to resolve
w3c/navigation-timing#215.

It enables developers to opt-in to get cross-origin redirect timings,
through destination-based Timing-Allow-Origin headers.

I2P: https://groups.google.com/a/chromium.org/g/blink-dev/c/GOPn8-wQlsk/m/x5Q3G6KuAgAJ

Change-Id: Ib463010f1862af523a241d2e9180ff09bfedb101
Bug: 521861828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7915892
Commit-Queue: Yoav Weiss (@Shopify) <yoavweiss@chromium.org>
Reviewed-by: Noam Rosenthal <nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1650808}

Co-authored-by: Yoav Weiss <yoavweiss@chromium.org>
yoavweiss added a commit to yoavweiss/WebKit that referenced this pull request Jun 24, 2026
…stination origin.

https://bugs.webkit.org/show_bug.cgi?id=316647

Reviewed by NOBODY (OOPS!).

This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513,
and ensures that TAO opt-ins for navigation timing take the destination origin into account.

* Source/WebCore/page/PerformanceNavigationTiming.cpp:
(WebCore::PerformanceNavigationTiming::redirectCount const):
* Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
(WebKit::NetworkLoadChecker::appendToNavigationTimingAllowValuesList):
(WebKit::NetworkLoadChecker::passesNavigationTAOCheck const):
(WebKit::NetworkLoadChecker::shouldExposeNavigationRedirectTiming):
* Source/WebKit/NetworkProcess/NetworkLoadChecker.h:
@annevk annevk merged commit aa0bd92 into main Jun 25, 2026
2 checks passed
@annevk annevk deleted the navigation_tao_destination branch June 25, 2026 06:36
annevk pushed a commit to whatwg/html that referenced this pull request Jun 25, 2026
yoavweiss added a commit to yoavweiss/WebKit that referenced this pull request Jun 26, 2026
…stination origin.

https://bugs.webkit.org/show_bug.cgi?id=316647

Reviewed by NOBODY (OOPS!).

This PR aligns the WebKit implementation with whatwg/fetch#1931 and whatwg/html#12513,
and ensures that TAO opt-ins for navigation timing take the destination origin into account.

No new tests, but a test progresses.

* LayoutTests/imported/w3c/web-platform-tests/navigation-timing/redirect-tao-expected.txt: Progression.
* Source/WebCore/page/PerformanceNavigationTiming.cpp:
(WebCore::PerformanceNavigationTiming::redirectCount const): TAO check.
* Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection): Append TAO values.
(WebKit::NetworkLoadChecker::validateResponse): Set TAO values on the response.
(WebKit::NetworkLoadChecker::appendToNavigationTimingAllowValuesList): Accumulate TAO values.
(WebKit::NetworkLoadChecker::passesNavigationTAOCheck const): Check if the response passes TAO check.
(WebKit::NetworkLoadChecker::shouldExposeNavigationRedirectTiming): helper method.
* Source/WebKit/NetworkProcess/NetworkLoadChecker.h:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants