Skip to content
Snippets Groups Projects
Unverified Commit 23e68ad0 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

bugfix: Allow only valid auth sources in MultiAuth.

The configuration of the MultiAuth authentication source specifies the auth sources that the user is presented with when asked for authentication. However, there was no proper check for the auth source selected by the user to ensure it is one of those allowed for MultiAuth.
parent 4bc62965
No related branches found
No related tags found
No related merge requests found
...@@ -143,7 +143,13 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source { ...@@ -143,7 +143,13 @@ class sspmod_multiauth_Auth_Source_MultiAuth extends SimpleSAML_Auth_Source {
assert('is_array($state)'); assert('is_array($state)');
$as = SimpleSAML_Auth_Source::getById($authId); $as = SimpleSAML_Auth_Source::getById($authId);
if ($as === NULL) { $valid_sources = array_map(
function($src) {
return $src['source'];
},
$state[self::SOURCESID]
);
if ($as === NULL || !in_array($authId, $valid_sources)) {
throw new Exception('Invalid authentication source: ' . $authId); throw new Exception('Invalid authentication source: ' . $authId);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment