Skip to content

Commit 1d5fd05

Browse files
authored
[css-view-transitions-1][css-view-transitions-2] Fix some refs and add security section (#9073)
* [css-view-transitions-1][css-view-transitions-2] Fix some refs and add security section * Clarify security issues
1 parent 653d0b1 commit 1d5fd05

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,17 +1049,17 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
10491049
which causes the transition to [=skip the view transition|skip=].
10501050
[Discussion of this behavior](https://github.com/w3c/csswg-drafts/issues/8045).
10511051

1052-
: <dfn>old state captured steps</dfn>
1052+
: <dfn>process old state captured</dfn>
10531053
:: An algorithm accepting nothing, or null.
10541054
Initially null.
10551055

10561056
Note: this is used for cross-document view transitions.
10571057
</dl>
10581058

1059-
A {{ViewTransition}} must never have both an [=ViewTransition/update callback=] and a [=ViewTransition/old state captured steps=].
1059+
A {{ViewTransition}} must never have both an [=ViewTransition/update callback=] and a [=ViewTransition/process old state captured=].
10601060

10611061
Note: [=ViewTransition/update callback=] is optionally set for same-document view transitions,
1062-
and [=ViewTransition/old state captured steps=] is set for cross-document view transitions.
1062+
and [=ViewTransition/process old state captured=] is set for cross-document view transitions.
10631063

10641064
The {{ViewTransition/finished}} [=getter steps=] are to return [=this's=] [=ViewTransition/finished promise=].
10651065

css-view-transitions-2/Overview.bs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ spec:css-view-transitions-1;
2626
text: named elements; for: ViewTransition; type: dfn;
2727
text: update callback done promise; for: ViewTransition; type: dfn;
2828
text: initial snapshot containing block size; for: ViewTransition; type: dfn;
29-
text: activate view transition; type: dfn;
3029
text: captured elements; type: dfn;
3130
text: updateCallbackDone; type: property; for: ViewTransition;
3231
text: phase; type: dfn; for: ViewTransition;
@@ -245,8 +244,6 @@ plus the additional rules noted below:
245244
: <dfn>enabled</dfn>
246245
:: The transition will be enabled if the navigation is same-origin, without cross-origin
247246
redirects.
248-
249-
See <a href="https://github.com/w3c/csswg-drafts/issues/8684">Issue #8684</a>.
250247
</dl>
251248

252249
# API # {#api}
@@ -414,3 +411,28 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
414411
This specification introduces no new privacy considerations.
415412

416413
<h2 id="sec" class="no-num">Security Considerations</h2>
414+
415+
To prevent cross-origin issues, at this point cross-document view transitions can only be enabled for
416+
same-origin navigations. As discussed in <a href="https://github.com/WICG/view-transitions/issues/200">WICG/view-transitions#200</a>,
417+
this still presents two potential threats:
418+
419+
1. The <a data-xref-type="http-header">Cross-Origin-Opener-Policy</a> of both documents might be different.
420+
This can cause a situation where a {{Document}} that is [=environment settings object/cross-origin isolated capability|cross-origin isolated=]
421+
can read image data from a document that is not cross-origin isolated. This is already mitigated in [[css-view-transitions-1#sec],
422+
as the same restriction applies for captured cross-origin iframes.
423+
424+
1. A same-origin navigation might still occur via a cross-origin redirect, e.g. <code>https://example.com</code>
425+
links to <code>https://auth-provider.com/</code> which redirects back to <code>https://example.com/loggedin</code>.
426+
427+
This can cause a (minor) situation where the cross-origin party would redirect the user to an
428+
unexpected first-party URL, causing an unexpected transition and obfuscating that fact that there was a redirect.
429+
To mitigate this, currently view transitions are disabled for navigations if the {{Document}} [=was created via cross-origin redirects=].
430+
Note that this check doesn't apply when the {{Document}} is being [=Document/reactivated=], as in that case
431+
the cross-origin redirect has already taken place.
432+
433+
Note: this only applies to server-side redirects. A client-side redirect, e.g. using
434+
[^meta/http-equiv/refresh^], is equivalent to a new navigation.
435+
436+
See <a href="https://github.com/w3c/csswg-drafts/issues/8684">Issue #8684</a> and
437+
<a href="https://github.com/WICG/view-transitions/issues/200">WICG/view-transitions#200</a> for
438+
detailed discussion.

0 commit comments

Comments
 (0)