File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1814,6 +1814,17 @@ private function doSamlAuthentication(): void
18141814 if (isset ($ params ['action ' ]) && $ params ['action ' ] === 'logout ' ) {
18151815 $ logout_url = $ params ['logout_url ' ] ?? '' ;
18161816 $ this ->logger ->info (sprintf ('Requested SAML logout: %s ' , $ logout_url ));
1817+ $ host = fn ($ url ) => parse_url ($ url ?: '' , PHP_URL_HOST );
1818+
1819+ // Invalid URL's will be catched by this too ($host($logout_url) is null but not in array).
1820+ if (!in_array ($ host ($ logout_url ), array_filter ([
1821+ 'localhost ' ,
1822+ $ host ($ this ->dic ->iliasIni ()->readVariable ('server ' , 'http_path ' )),
1823+ $ host ($ this ->dic ->settings ()->get ('soap_wsdl_path ' )),
1824+ ]), true )) {
1825+ throw new Exception ('Redirect URL not allowed ' );
1826+ }
1827+
18171828 $ auth ->logout ($ logout_url );
18181829 }
18191830
You can’t perform that action at this time.
0 commit comments