Allow to control Same-Site attribute for OIDC state cookie#52642
Allow to control Same-Site attribute for OIDC state cookie#52642sberyozkin merged 1 commit intoquarkusio:mainfrom
Conversation
|
🙈 The PR is closed and the preview is expired. |
There was a problem hiding this comment.
I'd be much more comfortable to make a breaking change and make strict default. I don't believe every user reads all our config properties and documentation (I never did, though I am not user per say). We would add it to the migration guide and users are supposed to read migration guides, so it would be fine.
But as far as I am concerned, this change is positive.
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcUtils.java
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcUtils.java
Outdated
Show resolved
Hide resolved
|
@michalvavrik hi Michal, as I said in the description and as shown in the linked old issue, state cookie in a strict mode broke applications. |
That is fine, because it only broke "some" applications and if users set it to
Here, we are already going in a circle, I explained my opinion on that in my initial comment, so I suggest to just leave it as you introduced here as |
It is already lax by default on |
This is a fair point, but this is certainly a bigger concern than the same site attribute. And again, it is not about users making a decision in those linked cases whether to stay on lax or strict for the state cookie - the application just does not work with state cookie in a strict same site mode |
e14ae88 to
d883340
Compare
|
@michalvavrik Hey, so first of all, I cleaned up the Your point about the security first is worth discussing further in the bigger context, I have probably a 5 year old issue to enable the authentication by default when the security capability is detected. I guess the key point is that users have a choice, toggle it off or keep it on, but in the case I linked to - they don't and that changes the picture completely. Anyway, I propose we discuss it further without delaying it for too long. |
|
@qkxy, hi, is there a chance you can test this PR and verify both the state and session cookies with the same site=none are removed by the browser ? Thanks |
Sure, I will get back to you with the result. |
Hmm, I have tried to find out just from reading code, so it is my bad I didn't mention it is actually set somewhere. I thought it was simply unset, which is not the same as when it is set explicitly (AKA "default lax" is not the same as "lax" explicitly set and firefox behaves differently depending on the version). I think we don't understand each other though - I think this change is fine. I just questioned if we can do better (strict).
I know about that issue. That and you saying "the security first" from time to time (in other words) made me to raise this. Yeah, I like the idea of secure profile that will harden defaults. We should go back to it. |
I built my app using this PR version of Quarkus, and the q_auth cookie is created and removed with SameSite=None and the browser didn’t block it. |
|
Thanks @qkxy |
Status for workflow
|
|
@michalvavrik Just FYI, GitHub OAuth2 sets Same-site lax too by default |
Ok |
Fixes #52607
Currently only the session cookie can have its same-site attribute controlled, the session cookie has its lax by default.
As per the links from the issue, originally, I started with both the session and state cookies sharing the same Same-site values that broke several applications once it is set to
Strict, when thesession-cookie: strict,state-cookie: laxtypically works.Other than that, in #52607, we found a workaround for the authentication to work by controlling the state cookie same site status at the Vert.x HTTP level - but it does require disabling the mullti-tab auth. Additionally the reporter discovered that for same site none cookies this attribute has to be set when the cookie is removed
So having a dedicated property to control it for the state cookie works best.