Skip to content

Specify the behavior of COEP: credentialless, - #1229

Merged
annevk merged 16 commits into
whatwg:mainfrom
ArthurSonzogni:coep-credentialless
Nov 3, 2021
Merged

annevk merged 16 commits into
whatwg:mainfrom
ArthurSonzogni:coep-credentialless

Conversation

@ArthurSonzogni

@ArthurSonzogni ArthurSonzogni commented May 3, 2021 •

Copy link
Copy Markdown
Member

Originally described in: https://github.com/mikewest/credentiallessness

credentialless and require-corp are similar. One or the other is a requirements for the window.crossOriginIsolated capability.
They differ mostly in the fetch specification. require-corp requires a CORP header for cross-origin no-cors responses. credentialless doesn't, but omits credentials (Cookies, clients certificates, etc...) in the request.

  • HTML (Add credentialless value to COEP (HTML spec) html#6638)

    • Define how to parse the credentialless value.
    • From the HTML spec point of view, credentialless and require-corp are equivalent. They have been grouped into compatible with cross-origin isolation and the HTML spec rewritten to use this concept.
  • Fetch: (Specify the behavior of COEP: credentialless, #1229)

    • Define Cross-Origin-Embedder-Policy allows credentials algorithm. It omit credentials for no-cors, cross-origin, COEP:credentialless requests.
    • Define response's request-include-credentials flag.
    • In the Cross-Origin-Resource-Policy check, if embedderPolicy is credentialless, require CORP for navigational responses, and opaque responses with request-include-credentials.

See: whatwg/html#6637


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


Preview | Diff

@ArthurSonzogni

Copy link
Copy Markdown
Member Author

This is still work in progress.
I still need write PR for ServiceWorker. Happy to get early feedback if you have nevertheless.

@whatwg/cross-origin-isolation @antosart @iVanlIsh

@ArthurSonzogni

Copy link
Copy Markdown
Member Author

I wrote page gathering the two PR in a single page if you want to have a broader view:
https://htmlpreview.github.io/?https://github.com/mikewest/credentiallessness/blob/master/index.html

Would you have some suggestion?

The warning I have:

LINK ERROR: No 'dfn' refs found for 'credentialless'.
<a data-link-for="embedder policy value" data-link-type="dfn" data-lt="credentialless">credentialless</a>

will be resolved when landing the HTML PR.

Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
@yutakahirano

Copy link
Copy Markdown
Member

Don't you want to compare request's current URL's origin and request's origin, rather than request's origin and request's client's origin?

@ArthurSonzogni

Copy link
Copy Markdown
Member Author

Don't you want to compare request's current URL's origin and request's origin, rather than request's origin and request's client's origin?

Yes, this should be the current URL instead of the URL. Fixed in "Address Yutaka comment #2"
However the second origin should continue to be the client's origin. For instance, in the base case of a cross-origin no-cors request with no redirects, credentials must not be included. So the comparison is in between the client's origin and the request's current URL.

@yutakahirano

Copy link
Copy Markdown
Member

However the second origin should continue to be the client's origin. For instance, in the base case of a cross-origin no-cors request with no redirects, credentials must not be included. So the comparison is in between the client's origin and the request's current URL.

Sorry, can you give me an example? request's origin and request's client's origin are usually the same, but other checks such as CORS use request's origin, so I want to understand why in this case we need to use the client's origin.

@ArthurSonzogni

ArthurSonzogni commented Jun 10, 2021 •

Copy link
Copy Markdown
Member Author

What is the main difference in between request's origin and request's client's origin?

Do you foresee a case where the difference matter for COEP:credentialless?

@yutakahirano

Copy link
Copy Markdown
Member

What is the main difference in between request's origin and request's client's origin?

For example, process a nativate fetch manually sets request's origin (step 4.1).

Do you foresee a case where the difference matter for COEP:credentialless?

Regarding this algorithm, no. For requests with mode: "no-cors", I believe they match. In any case, request's origin is the source of truth for other checks, so using it here is better for consistency.

@ArthurSonzogni

Copy link
Copy Markdown
Member Author

Regarding this algorithm, no. For requests with mode: "no-cors", I believe they match. In any case, request's origin is the source of truth for other checks, so using it here is better for consistency.

Thanks! I addressed this in 9f0be6a.

Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated

@ArthurSonzogni ArthurSonzogni left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks Yutaka,
I addressed your 3 comments in the latest commit.

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
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 20, 2021
In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug:1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
@annevk

annevk commented Sep 21, 2021

Copy link
Copy Markdown
Member

From CI it seems like this needs rebasing or at least some modernizing as embedder policy is now part of policy container.

(Draft)

Originally described in: https://github.com/mikewest/credentiallessness

`credentialless` and `require-corp` are similar. One or the other is a requirements for the `window.crossOriginIsolated` capability.
They differ mostly in the fetch specification. `require-corp` requires a CORP header for cross-origin no-cors responses. `credentialless` doesn't, but omits credentials (Cookies, clients certificates, etc...) in no-cors cross-origin requests.

* HTML (whatwg/html#6638)
  * Define how to parse the `credentialless` value.
  * From the HTML spec point of view, `credentialless` and `require-corp` are equivalent. They have been grouped into `compatible with crossOriginIsolation` and the HTML spec rewritten to use this concept.

* Fetch: (This PR)
  * Define "Cross-Origin-Embedder-Policy allows credentials".
  * Omit credentials for no-cors, cross-origin, COEP:credentialless requests.
  * Check CORP for navigational COEP:credentialless response.

* ServiceWorker: XXX
  * Integration with `Cache.matchAll `algorithm.
  * XXX

See: whatwg/html#6637

----

- [ ] At least two implementers are interested (and none opposed):
   * Chrome: https://chromestatus.com/feature/4918234241302528#details
   * Firefox: XXX
   * Safari: XXX

- [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://wpt.fyi/results/html/cross-origin-embedder-policy/credentialless/credentialless

- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: https://crbug.com/1175099
   * Firefox: XXX
   * Safari: XXX

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

----

See: whatwg/html#6637

@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.

Modulo nits this looks okay to me.

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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 22, 2021
In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Sep 22, 2021
In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}
pull Bot pushed a commit to luojiguicai/chromium that referenced this pull request Sep 22, 2021
In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 3, 2021
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Oct 4, 2021
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 4, 2021
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Oct 6, 2021
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
ArthurSonzogni added a commit to ArthurSonzogni/html that referenced this pull request Oct 20, 2021
Define COEP:credentialless

Originally described in: https://github.com/mikewest/credentiallessness

`credentialless` and `require-corp` are similar. One or the other is a requirements for the `window.crossOriginIsolated` capability.
They differ mostly in the fetch specification. `require-corp` requires a CORP header for cross-origin no-cors responses. `credentialless` doesn't, but omits credentials (Cookies, clients certificates, etc...) in the request.

* HTML (whatwg#6638)
  * Define how to parse the `credentialless` value.
  * From the HTML spec point of view, `credentialless` and `require-corp` are equivalent. They have been grouped into `compatible with cross-origin isolation` and the HTML spec rewritten to use this concept.

* Fetch: (whatwg/fetch#1229)
  * Define `Cross-Origin-Embedder-Policy allows credentials` algorithm. It omit credentials for no-cors, cross-origin, COEP:credentialless requests.
  * Define `response's` `request-include-credentials` flag.
  * In the `Cross-Origin-Resource-Policy check`, if `embedderPolicy` is `credentialless`, require CORP for navigational responses, and opaque responses with `request-include-credentials`.

See: whatwg#6637

----

- [ ] At least two implementers are interested (and none opposed):
   * Chrome: https://chromestatus.com/feature/4918234241302528#details
   * Firefox: mozilla/standards-positions#539  (worth prototyping)
   * Safari: https://lists.webkit.org/pipermail/webkit-dev/2021-June/031898.html (pending)

- [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://wpt.fyi/results/html/cross-origin-embedder-policy/credentialless

- [X] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: https://crbug.com/1175099
   * Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1731778
   * Safari: https://bugs.webkit.org/show_bug.cgi?id=230550

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated

@ArthurSonzogni ArthurSonzogni left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks! @domenic, I addressed your last comments.

Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
annevk pushed a commit to whatwg/html that referenced this pull request Nov 2, 2021
This defines Cross-Origin-Embedder-Policy: credentialless. The credentialless and require-corp values are similar. One or the other is a requirements for the cross-origin isolated capability. They differ mostly in terms of fetching. require-corp requires a Cross-Origin-Resource-Policy header for cross-origin opaque responses. credentialless doesn't, but omits credentials (cookies, client certificates, etc.) in cross-origin "no-cors" requests.

See https://github.com/WICG/credentiallessness for additional context.

Fetch PR: whatwg/fetch#1229.

Tests: WPT html/cross-origin-embedder-policy/credentialless.

Closes #6637.
@annevk

annevk commented Nov 2, 2021 •

Copy link
Copy Markdown
Member

This can land tomorrow once HTML has been indexed by Shepherd. Note that I made a couple last minute changes, but they are all editorial.

@annevk

annevk commented Nov 3, 2021

Copy link
Copy Markdown
Member

It seems Shepherd has not run. (At least, as far as I can tell HTML was updated and the new term followed an existing pattern that does work and having checked all those things again I cannot find any errors.) @tabatkins @plinss, is that known?

@plinss

plinss commented Nov 3, 2021

Copy link
Copy Markdown

Shepherd has been blocked for the last 18 hours or so, it just ran. The last version of fetch it scanned was published on 2021-11-01 01:32:23 PDT

@annevk
annevk merged commit 0613515 into whatwg:main Nov 3, 2021
@annevk

annevk commented Nov 3, 2021

Copy link
Copy Markdown
Member

Thanks @plinss!

@annevk

annevk commented Nov 3, 2021

Copy link
Copy Markdown
Member

And thanks @ArthurSonzogni for the work on the PR, of course! And @domenic and @yutakahirano for the reviews! 😊

@ArthurSonzogni

Copy link
Copy Markdown
Member Author

Awesome! 🚀
Thanks @annevk, @domenic, @yutakahirano for the reviews!
I learnt a lot from you.

Gabisampaio pushed a commit to Gabisampaio/wpt that referenced this pull request Nov 18, 2021
In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}
dandclark pushed a commit to dandclark/html that referenced this pull request Dec 4, 2021
This defines Cross-Origin-Embedder-Policy: credentialless. The credentialless and require-corp values are similar. One or the other is a requirements for the cross-origin isolated capability. They differ mostly in terms of fetching. require-corp requires a Cross-Origin-Resource-Policy header for cross-origin opaque responses. credentialless doesn't, but omits credentials (cookies, client certificates, etc.) in cross-origin "no-cors" requests.

See https://github.com/WICG/credentiallessness for additional context.

Fetch PR: whatwg/fetch#1229.

Tests: WPT html/cross-origin-embedder-policy/credentialless.

Closes whatwg#6637.
mfreed7 pushed a commit to mfreed7/html that referenced this pull request Jun 3, 2022
This defines Cross-Origin-Embedder-Policy: credentialless. The credentialless and require-corp values are similar. One or the other is a requirements for the cross-origin isolated capability. They differ mostly in terms of fetching. require-corp requires a Cross-Origin-Resource-Policy header for cross-origin opaque responses. credentialless doesn't, but omits credentials (cookies, client certificates, etc.) in cross-origin "no-cors" requests.

See https://github.com/WICG/credentiallessness for additional context.

Fetch PR: whatwg/fetch#1229.

Tests: WPT html/cross-origin-embedder-policy/credentialless.

Closes whatwg#6637.
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…r., a=testonly

Automatic update from web-platform-tests
[credentialless] Update redirect behavior.

In the Fetch specification PR, we changed our mind and decided to omit
credentials as soon as there at least one cross-origin request.
Previously, only the current URL was taken into account.

See:
whatwg/fetch#1229 (comment)

Bug: 1175099
Change-Id: I308281bdab95be264ca7a2ef990341bddd0e9bc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168346
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923884}

--

wpt-commits: 2d6d77b3054e9b7f35bdd2b3e7de9b53ecfed7d5
wpt-pr: 30871
@koal44 koal44 mentioned this pull request Sep 19, 2026
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.

6 participants