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

Fix BackURL redirect with strict or lax session cookie security. #55

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

mateusz
Copy link
Contributor

@mateusz mateusz commented Jan 10, 2024

Should fix #45

Needs cross-check, I only tested it on my SAML setup with Google Workspace.

Also, someone wearing a security hat should see if this is ok.

@@ -75,7 +75,8 @@ public function redirect(RequestHandler $requestHandler = null, HTTPRequest $req
$additionalGetQueryParams = $this->getAdditionalGETQueryParameters();

try {
$auth->login(Director::absoluteBaseURL() . 'saml/', $additionalGetQueryParams);
Copy link
Contributor Author

@mateusz mateusz Jan 10, 2024

Choose a reason for hiding this comment

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

By the way, this usage of login's first parameter is wrong, it results in a URL like https://mysite.comsaml/, i.e. it's missing the slash. The bug didn't manifest as an issue, because RelayState isn't used anyway.

Copy link
Collaborator

@satrun77 satrun77 left a comment

Choose a reason for hiding this comment

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

@satrun77 satrun77 merged commit 798d503 into silverstripe:main Jan 24, 2024
9 checks passed
@mateusz mateusz deleted the fix-back-url branch January 24, 2024 23:35
jareddreyerss added a commit that referenced this pull request Feb 27, 2024
See #55 PR for more context.

This is merely a cherry pick / copy of that commit but for the 2 branch so in theory should work in SS 4.x
satrun77 pushed a commit that referenced this pull request Feb 28, 2024
See #55 PR for more context.

This is merely a cherry pick / copy of that commit but for the 2 branch so in theory should work in SS 4.x
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.

Session-cookie with samesite = strict breaks login-procedure
2 participants