Closed (fixed)
Project:
SAML Authentication
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Jul 2019 at 13:13 UTC
Updated:
4 May 2021 at 08:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
klausiUploading the latest patch we discussed in the private security issue.
Author of the patch: smfsh
Comment #3
klausiThis is not enough - we need to check if there were any errors before we trust the return value.
parenthesis should be removed.
this is not ideal because then this is vulnerable to logout CSRF attacks. We should only log out the user if the processed SAML request was valid.
Comment #4
roderikOh right, I failed to spot that in first review. To say this in terms of comparing to the 8.x-2/3.x version: that first does Auth::processSLO() and
* if the function returns normally: calls Auth::getErrors()
* if not: catches the exception
And if either an exception is caught or there are errors: does not log out.
7.x should do the same.
Comment #5
nironan commentedHere's an attempt to fix the issue as suggested
Comment #6
roderikThis looks good to me. (I haven't tested, myself: I've never run D7 samlauth. But from reading the patch, it's clear that the only difference between the first and second patch is "being conservative with logging out if errors were encountered / reported".)
Comment #8
roderikIt seems I'm the 7.x maintainer too now. Oh well... :)
Thanks again for this.
I did make one change, because in the meantime I learnt how SLS actually works (#3043704-9: Make user logout more robust), which means the returned $url can be empty. So I added a " ?: '' ". And changed some comments.
Comment #10
roderikOh, no. That wasn't as intended. $url needs to stay empty there.
But if there was an error and/or no RelayState was set, then it needs to be set to <front>
I unfixed my 'fix' and refixed it in another way... hoping it's covered now...
Comment #11
roderikOh.
'' means the same as '<front>' in drupal_goto(). Which means the patch in #5 is good. (We'd just pass either value into drupal_goto(), depending on whether there were any errors.)
Oh well. Now we're passing a consistent value ¯\_(ツ)_/¯