Skip to content

Why must SameSite=none? #587

Open
Open

Description

@anderspitman

I've searched the repo and read through #212 and #248 but I'm still confused about the SameSite=none requirement.

LastLogin currently uses SameSite=lax for all cookies. Changing to none potentially opens up several vulnerabilities that need to be carefully considered. I get some protection from CORS, but there are so many edge cases that things can slip through with "simple requests" etc. I could also add a tiny sentinel cookie set with SameSite=lax and then require both cookies for all endpoints except FedCM, but again that requires me to get it right everywhere, which is dangerous.

Overall, why is this necessary in the first place? It seems like a very intentional decision, but I haven't found a clear explanation yet. As @samuelgoto mentions here it seems to me that FedCM already is secure enough to be trusted sending lax cookies.

Activity

  1. sebadob commented on May 20, 2024

    @sebadob

    That's a big pain point for me as well and I would actually never deploy something to prod with this setting.

    I think the browser should just sent even host only cookies to the IdP in that case and since it's behind the scenes anyway, I don't see an issue with doing that. The other way around, setting SameSite=None is something I would never do these days, as it would be like 3 steps back in terms of security.

  2. anderspitman commented on May 20, 2024

    @anderspitman
    Author

    @samuelgoto any additional info on this?

  3. samuelgoto commented on May 20, 2024

    @samuelgoto
    Collaborator

    @samuelgoto any additional info on this?

    We are working with our privacy and security reviewers to figure out what we can do about this. Will report back.

  4. samuelgoto commented on May 20, 2024

    @samuelgoto
    Collaborator

    We are working with our privacy and security reviewers to figure out what we can do about this. Will report back.

    @johannhof I hear that this is working as intended. Can you help us understand why SameSite=None is required and SameSite=Lax wouldn't suffice?

  5. cbiesinger commented on May 21, 2024

    @cbiesinger
    Collaborator
  6. johannhof commented on May 21, 2024

    @johannhof
    Contributor

    I think I understand your concern and that you consider requests initiated by FedCM to meet a higher bar than "regular" cross-site fetch requests, however, let's look at the available options and their current definitions:

    • SameSite=Strict, for same-site requests (which e.g. accounts endpoint is clearly not, as it's triggered in a cross-site context)
    • SameSite=Lax, for same-site requests and cross-site top-level navigations (which this is also not)
    • SameSite=None

    Of course, we can revisit and change things if they don't make sense. This was discussed in #248 and the suggestion back then was to add a SameSite=Federated attribute, which probably doesn't work due to backwards/cross-browser compat issues.

    We could consider broadening the definition of SameSite=Lax to cover things like browser-UI triggered requests, but we'd need to make sure that we're not inadvertently opening up an attack surface for anyone. If you were previously using the above definition to protect your endpoints you may be surprised to learn that there's a new cross-site way to trigger SameSite=Lax cookies.

    cc @arturjanc for thoughts

  7. johannhof commented on May 21, 2024

    @johannhof
    Contributor
  8. anderspitman commented on May 21, 2024

    @anderspitman
    Author

    Thanks @johannhof.

    I think the problem is that FedCM requests feel like a new thing. Is there any precedent for requests that are sent by the browser but which the origin has no direct control over the method, content, or response (only the URI can be controlled by the RP)?

    I can see why you technically consider them to be cross-site requests since they wouldn't be fired without visiting an RP, but do they really fit the description of what we've always considered cross-site on the web up to this point? The term is generally used in conversations involving CSRF security concerns and privacy, and I haven't been able to come up with any scenarios where FedCM requests would introduce a security vulnerability (caveat: I am not a security expert). The endpoints are highly prescribed and the results aren't directly accessible to the RP.

    On the flip side, forcing all cookies to be SameSite=none for FedCM introduces real, tangible security issues.

  9. johannhof commented on May 21, 2024

    @johannhof
    Contributor

    Yeah, I understand the negative security implications this would cause for IdPs in the mid term (that is, until 3rd party cookies are blocked by default without workarounds in all browsers) and I agree it's not a great outcome.

    I'm honestly torn on this issue. I'd love to hear from some of the tagged folks (@arturjanc @annevk @bvandersloot-mozilla) regarding their thoughts on a possible inclusion of FedCM requests in SameSite=Lax rules.

  10. sebadob commented on May 21, 2024

    @sebadob

    I think it would make a lot of sense to even be able to set host only cookies, even with __Host-* and have the FedCM send them anyway, even it is is technically cross origin. It would not be a security issue or against any "rules", because the FedCM API operates behind the scenes from inside the browser and not on the user-facing side, and can be trusted.

    On the other hand, if we would set host only or samesite cookies, they are restricted to the IdPs domain / host and would not leak anywhere else, even when the FedCM is not used.

  11. johannhof commented on May 22, 2024

    @johannhof
    Contributor

    Chatted with @arturjanc about this offline, and the fact that all these endpoints have to be pre-registered by the IdP in a config file makes us think that carving this out as a new instance where SameSite=Lax cookies are sent might be acceptable. I would also be interested in @mikewest's thoughts on that idea.

    @sebadob relaxing cross-origin restrictions feels like a fundamentally different suggestion and much less likely to happen, as that is a concern of not leaking additional data to the IdP endpoint (which could also be a risk to that endpoint itself, if there are ways for subdomains to set the cookies it is looking for). This is all very hard to reason about and it's important that we don't pull the rug on security concepts people are relying on.

  12. sebadob commented on May 22, 2024

    @sebadob

    @johannhof don't get me wrong, I would never want this to be a global change, only for these specific endpoints where we actually need the cookies during the FedCM flow. Basically like you suggested.

    The SameSite attribute is one of the best defenses we have against CSRF attacks. I would never want to give that up just to support some new auth flow, even if it provides a really nice UX, and rather stick to OAuth / OIDC on its own.

  13. annevk commented on May 22, 2024

    @annevk

    I don't understand the discussion about __Host- cookies. That's a syntactic mechanism to enforce a couple of attributes of a cookie. It's unrelated to SameSite and can always be used. Are you suggesting to change the semantics in some way? If so, please explain by way of an example involving the multiple parties. But also, if it's not related to SameSite it should probably be its own issue.

    Creating a new avenue for SameSite=Lax exploits makes me rather nervous. I guess to some extent the question here is whether the "speedbumps" for attackers as 6265bis puts it are equivalent.

    (Also, you never get protection from CORS. The protection is from the same-origin policy. CORS pokes holes in that.)

  14. sebadob commented on May 22, 2024

    @sebadob

    I don't understand the discussion about __Host- cookies. That's a syntactic mechanism to enforce a couple of attributes of a cookie. It's unrelated to SameSite and can always be used. Are you suggesting to change the semantics in some way? If so, please explain by way of an example involving the multiple parties. But also, if it's not related to SameSite it should probably be its own issue.

    Sorry the __Host- does not belong here, that's true, my bad.

    Edit:

    The main question was actually only, why the FedCM wants SameSite=None cookies when Lax should not be an issue.

  15. anderspitman commented on May 22, 2024

    @anderspitman
    Author

    I appreciate the time being taken to seriously consider this concern. Honestly the situation makes me a bit uneasy. Just because it seems safer to relax SameSite=lax than to require SameSite=none doesn't necessarily mean that's the case. My instincts tell me this should be treated as a new thing. The SameSite=federated suggestion should work. But if people who know more about security than me (not a high bar) sign off on SameSite=lax being relaxed, I won't complain.

  16. 58 remaining items

  17. annevk commented on Sep 12, 2025

    @annevk

    Presumably you'd include the context in the request?

  18. hlflanagan commented on Oct 28, 2025

    @hlflanagan
    Contributor

    Discussed 28 October 2025

  19. cbiesinger commented on Oct 31, 2025

    @cbiesinger
    Collaborator

    Starting in tomorrow's Chrome Canary, you can test this using --enable-features=SendSameSiteLaxForFedCM. Sorry, this is not listed in chrome://flags, but will work from the commandline

  20. annevk commented on Nov 3, 2025

    @annevk

    The minutes suggest I'm open to this change, which is true, but I did stipulate some preconditions, no?

  21. cbiesinger commented on Nov 3, 2025

    @cbiesinger
    Collaborator

    The minutes suggest I'm open to this change, which is true, but I did stipulate some preconditions, no?

    I apologize if I misrepresented your position. I am aware of the preconditions and sending those emails is still on my TODO list.

  22. cbiesinger commented on Nov 4, 2025

    @cbiesinger
    Collaborator
  23. cbiesinger commented on Dec 9, 2025

    @cbiesinger
    Collaborator

    Starting in tomorrow's Chrome Canary, you can test this using --enable-features=SendSameSiteLaxForFedCM. Sorry, this is not listed in chrome://flags, but will work from the commandline

    @anderspitman / others, I am still interested in hearing if this is working for you!

  24. anderspitman commented on Dec 9, 2025

    @anderspitman
    Author

    Sorry @cbiesinger busy times for me, but I'll see if I can carve out a couple hours to play with this in the next 2 weeks. Are there any looming deadlines on your end where it would be nice to get this tested?

  25. cbiesinger commented on Dec 10, 2025

    @cbiesinger
    Collaborator

    Thanks @anderspitman . No particular timeline, I just don't want to start going through the shipping process before someone has actually tried this out.

  26. will-bartlett commented on May 10, 2026

    @will-bartlett

    I stumbled across this today. +1 for this being a problem. Big picture - SameSite is used to protect websites against unexpected requests. FedCM requests are never unexpected, because the browser will only make them cross origin if the origin has configured a well known file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions