spring-projects / spring-projects/spring-security
Improve Single-Sign-On Redirect for SameSite=Lax and SameSite=Strict
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Lax + POST mitigation as well as the following Spring Security tickets:
- https://github.com/spring-projects/spring-security/issues/14013
- https://github.com/spring-projects/spring-security/issues/11468
explain some of the difficulties around using SameSite=Lax or SameSite=Strict when using SSO technologies like SAML and others that redirect with a POST.
There are a few ways to consider:
-
Provide an implementation of
CookieSameSiteSupplierthat writes the session cookie asSameSite=Nonepre-login and asSameSite=Strictpost-login (Boot-specific solution) -
Have the session cookie always be
SameSite=Noneand introduce aSameSite=Strictcorrelation cookie when authentication succeeds. The correlation cookie has a secure random value that must match a certain session attribute, lest the session be invalidated. -
Add a separate
SameSite=Nonecookie whose opaque token references pre-login information, the opaque token could be theRelayState. It would be created when login begins and destroyed when login completes either successfully or unsuccessfully. -
Use the Artifact binding instead (SAML-specific). Such allows the redirect from the IdP to be a GET instead of a POST.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Chromium SameSite FAQ and the linked Spring Security issues 14013 and 11468 to understand the SSO redirect constraints. Compare the four approaches listed here; the work is not ready to start until one approach and its affected entry points and tests are selected, with completion defined by correct same-site behavior for the supported SSO flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100