Skip to content

Set limit on size of providers #711

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Set limit on size of providers #711

wants to merge 1 commit into from

Conversation

npm1
Copy link
Collaborator

@npm1 npm1 commented Mar 31, 2025

@npm1 npm1 requested a review from cbiesinger March 31, 2025 15:40
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 31, 2025
We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 31, 2025
We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 31, 2025
We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}
@@ -794,6 +794,7 @@ the exception thrown.
{{IdentityCredentialRequestOptionsMode/passive}} on |globalObject|'s [=Window/navigable=]'s
[=navigable/top-level traversable=] or on any of its descendants, reject the pending
request with a "{{NetworkError}}" {{DOMException}}.
1. If |providerList|'s [=list/size=] is greater than 10, return (failure, true).
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems arbitrarily small. I understand some of the risks if it is too large, but it seems to me it should not be hard-coded at the spec level. Relevant admin users should be able to adjust this as appropriate to a given deployment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can add enterprise settings in order to make this larger for admins that control browser deployments if needed. But I think it is more interoperable to have a concrete specific (and yes, arbitrary) value here so that the behavior is consistent across browsers and developers do not accidentally request a number of IdPs which works on some browsers but not on others.

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when there are ten large IdPs and some number of small? Or is there an unstated goal to limit the overall number of IdPs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what the size of the IdP has to do with anything? We want to limit the number of IdPs that a single RP can request in one go. Each IdP in the request can potentially introduce 5+ fetches so it would be too slow to include too many IdPs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine, limiting the size of the IdP pool to 5 providers. Who might they be? Probably GoogleIdP, XIdP, AppleIdP, MicrosoftIdP, maybe GitHubIdP. What about JoeSmithIdP? What about DisneyIdP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Federation is not only done through FedCM, so the question about today is about the current state of the world.

I'll reiterate that what you are imagining is not feasible without IDP registration, because the RP would need to embed one SDK per IDP, and we'd need to perform multiple fetches per IDP. So a get() with hundreds of IDPs is not feasible.

This limit is intended to only be limiting to people attempting to abuse the API. We can always change it or increase it if there are real-world requests where they would need a larger limit. Today, the largest I've seen is 5, so the limit I am proposing is double that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But IDP registration is something we want to do, and that use case is entirely boxed out by this approach to limiting only to 10.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why is that? Usually you just need 1 IDP in your get call to request any registered IDP. We can also tweak the limit to completely exclude registration cases if needed, when we spec that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see, this is the provided idp config list, not the actual set that shows up in the UI. I was a little turned around. Then I don't have strong opinions against this, but it really isn't needed in Firefox because of the IDP chooser.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. We don't need to add this to the spec, as I think the spec already provides enough leeway for the user agent to reject a request for whatever reason. But I figured it might be helpful to have a shared limit to reduce possible compat issues.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 4, 2025
…ed, a=testonly

Automatic update from web-platform-tests
[FedCM] Limit the number of IDPs requested

We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}

--

wpt-commits: a5f4f35aa3381bcf01ceac355ff777608e9a5570
wpt-pr: 51725
aosmond pushed a commit to aosmond/gecko that referenced this pull request Apr 4, 2025
…ed, a=testonly

Automatic update from web-platform-tests
[FedCM] Limit the number of IDPs requested

We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}

--

wpt-commits: a5f4f35aa3381bcf01ceac355ff777608e9a5570
wpt-pr: 51725
@npm1 npm1 added the agenda+ Regular CG meeting agenda items label Apr 7, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Apr 8, 2025
…ed, a=testonly

Automatic update from web-platform-tests
[FedCM] Limit the number of IDPs requested

We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}

--

wpt-commits: a5f4f35aa3381bcf01ceac355ff777608e9a5570
wpt-pr: 51725
globau pushed a commit to globau/firefox-test that referenced this pull request Apr 8, 2025
…ed, a=testonly

Automatic update from web-platform-tests
[FedCM] Limit the number of IDPs requested

We reject in the renderer when more than 10 IDPs are requested. Then we
ReportBadMessageAndDeleteThis() in the browser if the same happens,
since an uncompromised renderer should not send this request.

Matches proposed spec change at
w3c-fedid/FedCM#711

Fixed: 399872188
Change-Id: I6ab154bed8034bbb15db34d20f2e30b0ea80d9aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6413326
Reviewed-by: Christian Biesinger <[email protected]>
Commit-Queue: Nicolás Peña <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1440313}

--

wpt-commits: a5f4f35aa3381bcf01ceac355ff777608e9a5570
wpt-pr: 51725
@TallTed
Copy link
Contributor

TallTed commented Apr 9, 2025

I think this issue's title should be changed from Set providers size limit to Set limit on ID provider count or similar.

@npm1
Copy link
Collaborator Author

npm1 commented Apr 9, 2025

I think this issue's title should be changed from Set providers size limit to Set limit on ID provider count or similar.

I think your suggestion is unclear. Let me set providers in quote, does that help

@npm1 npm1 changed the title Set providers size limit Set providers size limit Apr 9, 2025
@TallTed
Copy link
Contributor

TallTed commented Apr 9, 2025

"Set providers size limit" == "Set limit on size of providers", but this is not what is meant.

"Set limit on number of providers" is what is meant, and should be the title.

@npm1
Copy link
Collaborator Author

npm1 commented Apr 9, 2025

"Set limit on size of providers" is exactly what this PR does, not sure why you are saying that is not what is meant. I can change it to that

@npm1 npm1 changed the title Set providers size limit Set limit on size of providers Apr 9, 2025
@TallTed
Copy link
Contributor

TallTed commented Apr 9, 2025

"Set limit on size of providers" is exactly what this PR does

No. "Set limit on size of list of providers" or "Set limit on size of set of providers" is exactly what this PR does.

@npm1
Copy link
Collaborator Author

npm1 commented Apr 9, 2025

@hlflanagan
Copy link
Contributor

Discussed during the FedID WG/CG meeting 22 April 2025 https://github.com/w3c-fedid/meetings/blob/main/2025/2025-04-22-FedCM-agenda.md

1 similar comment
@hlflanagan
Copy link
Contributor

Discussed during the FedID WG/CG meeting 22 April 2025 https://github.com/w3c-fedid/meetings/blob/main/2025/2025-04-22-FedCM-agenda.md

@hlflanagan hlflanagan removed the agenda+ Regular CG meeting agenda items label Apr 22, 2025
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.

Limit the number of IDPs that may be requested
5 participants