Skip to content
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

Short IdP cookie lifetimes #621

Closed
yoavweiss opened this issue Jul 3, 2024 · 8 comments
Closed

Short IdP cookie lifetimes #621

yoavweiss opened this issue Jul 3, 2024 · 8 comments

Comments

@yoavweiss
Copy link

As part of an effort to reduce the blast radius of cookie theft, a recent proposal called Device Bound Session Credentials aims to enable service providers to have very short session cookie lifetimes, and revalidate them using DBSC without bothering the user (at a cost of a potentially-preflighted round trip).

That’s great as short-lived cookies are less-exploitable cookies, e.g. in cases the user has local malware on their machine.

However, AFAICT, that doesn’t work well for FedCM. If the IDP’s session cookie has expired, the only option to renew the cookie is through a user-visible modal, which would create a sub-optimal user experience and add a lot of friction.

Would it be possible to create an IDP cookie renewal flow that doesn’t require a user-facing modal?
From a security perspective, that seems fine, as cookie expiration times are at the discretion of the IDP, so performing renewals without a modal doesn’t seem to degrade the user’s security, and will enable short-lived cookies which would augment it. We will of course need to distinguish cookie expiration from e.g. server-side cookie invalidation.

Thoughts?

/cc @gioele-antoci

@yoavweiss yoavweiss changed the title FedCM and short cookie lifetimes Short IdP cookie lifetimes Jul 3, 2024
@wparad
Copy link

wparad commented Jul 3, 2024

If the IdP cookie has expired what's the alternative to asking the user to reauth if the website requires it?

@yoavweiss
Copy link
Author

The alternative is to run a DBSC negotiation and allow the IdP to renew its cookie without a top-level navigation.

@johannhof
Copy link
Contributor

Not sure I fully grok this issue. FedCM mediates a token that is requested from the IdP in a credentialed fetch https://fedidcg.github.io/FedCM/#identity-assertion-endpoint. Presumably such a request would be able to perform a DBSC negotiation without the need for any specific FedCM-level mechanics?

@samuelgoto
Copy link
Collaborator

Presumably such a request would be able to perform a DBSC negotiation without the need for any specific FedCM-level mechanics

That's partially my intuition too: DBSC does, indeed, make cookies shorter-lived, but it also refreshes them periodically, such that there are always valid cookies in the jar.

So, as far as I understand DBSC, its usage in conjunction with FedCM should be orthogonal: one shouldn't step on the other, I believe.

@yoavweiss does that match your intuition too?

@yoavweiss
Copy link
Author

I may have misunderstood the request flow.

I guess that if DBSC would properly delay requests going to the identity assertion endpoint with bound and expired cookies, this can work without bugging the user.

@samuelgoto
Copy link
Collaborator

delay requests going to the identity assertion endpoint

By the time we get to the id_assertion_endpoint, FedCM has already queried the accounts_endpoint, which is a credentialed fetch.

this can work without bugging the user.

Yeah, I believe that's the case, but it is worth trying it out and gathering implementation confidence.

@cbiesinger
Copy link
Collaborator

https://github.com/WICG/dbsc?tab=readme-ov-file#high-level-overview mentions that the request gets deferred while the DBSC is refreshed, so I am not sure there's anything to do in FedCM, especially spec-wise

@yoavweiss
Copy link
Author

Yeah, closing for now. Thanks for clarifying!!

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

No branches or pull requests

5 participants