Completed
Pull Request — master (#1132)
by Tim
15:36
created

lib/SimpleSAML/Auth/ProcessingChain.php (1 issue)

Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\Auth;
6
7
use SimpleSAML\Configuration;
8
use SimpleSAML\Error;
9
use SimpleSAML\Logger;
10
use SimpleSAML\Module;
11
use SimpleSAML\Utils;
12
13
/**
14
 * Class for implementing authentication processing chains for IdPs.
15
 *
16
 * This class implements a system for additional steps which should be taken by an IdP before
17
 * submitting a response to a SP. Examples of additional steps can be additional authentication
18
 * checks, or attribute consent requirements.
19
 *
20
 * @author Olav Morken, UNINETT AS.
21
 * @package SimpleSAMLphp
22
 */
23
24
class ProcessingChain
25
{
26
    /**
27
     * The list of remaining filters which should be applied to the state.
28
     */
29
    const FILTERS_INDEX = '\SimpleSAML\Auth\ProcessingChain.filters';
30
31
32
    /**
33
     * The stage we use for completed requests.
34
     */
35
    const COMPLETED_STAGE = '\SimpleSAML\Auth\ProcessingChain.completed';
36
37
38
    /**
39
     * The request parameter we will use to pass the state identifier when we redirect after
40
     * having completed processing of the state.
41
     */
42
    const AUTHPARAM = 'AuthProcId';
43
44
45
    /**
46
     * All authentication processing filters, in the order they should be applied.
47
     */
48
    private $filters;
49
50
51
    /**
52
     * Initialize an authentication processing chain for the given service provider
53
     * and identity provider.
54
     *
55
     * @param array $idpMetadata  The metadata for the IdP.
56
     * @param array $spMetadata  The metadata for the SP.
57
     * @param string $mode
58
     */
59
    public function __construct($idpMetadata, $spMetadata, $mode = 'idp')
60
    {
61
        assert(is_array($idpMetadata));
62
        assert(is_array($spMetadata));
63
64
        $this->filters = [];
65
66
        $config = Configuration::getInstance();
67
        $configauthproc = $config->getArray('authproc.' . $mode, null);
68
69
        if (!empty($configauthproc)) {
70
            $configfilters = self::parseFilterList($configauthproc);
71
            self::addFilters($this->filters, $configfilters);
72
        }
73
74
        if (array_key_exists('authproc', $idpMetadata)) {
75
            $idpFilters = self::parseFilterList($idpMetadata['authproc']);
76
            self::addFilters($this->filters, $idpFilters);
77
        }
78
79
        if (array_key_exists('authproc', $spMetadata)) {
80
            $spFilters = self::parseFilterList($spMetadata['authproc']);
81
            self::addFilters($this->filters, $spFilters);
82
        }
83
84
        Logger::debug('Filter config for ' . $idpMetadata['entityid'] . '->' .
85
            $spMetadata['entityid'] . ': ' . str_replace("\n", '', var_export($this->filters, true)));
86
    }
87
88
89
    /**
90
     * Sort & merge filter configuration
91
     *
92
     * Inserts unsorted filters into sorted filter list. This sort operation is stable.
93
     *
94
     * @param array &$target  Target filter list. This list must be sorted.
95
     * @param array $src  Source filters. May be unsorted.
96
     * @return void
97
     */
98
    private static function addFilters(array &$target, array $src)
99
    {
100
        foreach ($src as $filter) {
101
            $fp = $filter->priority;
102
103
            // Find insertion position for filter
104
            for ($i = count($target) - 1; $i >= 0; $i--) {
105
                if ($target[$i]->priority <= $fp) {
106
                    // The new filter should be inserted after this one
107
                    break;
108
                }
109
            }
110
            /* $i now points to the filter which should preceede the current filter. */
111
            array_splice($target, $i + 1, 0, [$filter]);
112
        }
113
    }
114
115
116
    /**
117
     * Parse an array of authentication processing filters.
118
     *
119
     * @param array $filterSrc  Array with filter configuration.
120
     * @return array  Array of ProcessingFilter objects.
121
     */
122
    private static function parseFilterList(array $filterSrc): array
123
    {
124
        $parsedFilters = [];
125
126
        foreach ($filterSrc as $priority => $filter) {
127
            if (is_string($filter)) {
128
                $filter = ['class' => $filter];
129
            }
130
131
            if (!is_array($filter)) {
132
                throw new \Exception('Invalid authentication processing filter configuration: ' .
133
                    'One of the filters wasn\'t a string or an array.');
134
            }
135
136
            $parsedFilters[] = self::parseFilter($filter, $priority);
137
        }
138
139
        return $parsedFilters;
140
    }
141
142
143
    /**
144
     * Parse an authentication processing filter.
145
     *
146
     * @param array $config      Array with the authentication processing filter configuration.
147
     * @param int $priority      The priority of the current filter, (not included in the filter
148
     *                           definition.)
149
     * @return \SimpleSAML\Auth\ProcessingFilter  The parsed filter.
150
     */
151
    private static function parseFilter(array $config, int $priority): ProcessingFilter
152
    {
153
        if (!array_key_exists('class', $config)) {
154
            throw new \Exception('Authentication processing filter without name given.');
155
        }
156
157
        $className = Module::resolveClass(
158
            $config['class'],
159
            'Auth\Process',
160
            '\SimpleSAML\Auth\ProcessingFilter'
161
        );
162
        $config['%priority'] = $priority;
163
        unset($config['class']);
164
165
        /** @var \SimpleSAML\Auth\ProcessingFilter */
166
        return new $className($config, null);
167
    }
168
169
170
    /**
171
     * Process the given state.
172
     *
173
     * This function will only return if processing completes. If processing requires showing
174
     * a page to the user, we will not be able to return from this function. There are two ways
175
     * this can be handled:
176
     * - Redirect to a URL: We will redirect to the URL set in $state['ReturnURL'].
177
     * - Call a function: We will call the function set in $state['ReturnCall'].
178
     *
179
     * If an exception is thrown during processing, it should be handled by the caller of
180
     * this function. If the user has redirected to a different page, the exception will be
181
     * returned through the exception handler defined on the state array. See
182
     * State for more information.
183
     *
184
     * @see State
185
     * @see State::EXCEPTION_HANDLER_URL
186
     * @see State::EXCEPTION_HANDLER_FUNC
187
     *
188
     * @param array &$state  The state we are processing.
189
     * @throws \SimpleSAML\Error\Exception
190
     * @throws \SimpleSAML\Error\UnserializableException
191
     * @return void
192
     */
193
    public function processState(&$state)
194
    {
195
        assert(is_array($state));
196
        assert(array_key_exists('ReturnURL', $state) || array_key_exists('ReturnCall', $state));
197
        assert(!array_key_exists('ReturnURL', $state) || !array_key_exists('ReturnCall', $state));
198
199
        $state[self::FILTERS_INDEX] = $this->filters;
200
201
        try {
202
            // TODO: remove this in SSP 2.0
203
            if (!array_key_exists('UserID', $state)) {
204
                // No unique user ID present. Attempt to add one.
205
                self::addUserID($state);
206
            }
207
208
            while (count($state[self::FILTERS_INDEX]) > 0) {
209
                $filter = array_shift($state[self::FILTERS_INDEX]);
210
                $filter->process($state);
211
            }
212
        } catch (Error\Exception $e) {
213
            // No need to convert the exception
214
            throw $e;
215
        } catch (\Exception $e) {
216
            /*
217
             * To be consistent with the exception we return after an redirect,
218
             * we convert this exception before returning it.
219
             */
220
            throw new Error\UnserializableException($e);
221
        }
222
223
        // Completed
224
    }
225
226
227
    /**
228
     * Continues processing of the state.
229
     *
230
     * This function is used to resume processing by filters which for example needed to show
231
     * a page to the user.
232
     *
233
     * This function will never return. Exceptions thrown during processing will be passed
234
     * to whatever exception handler is defined in the state array.
235
     *
236
     * @param array $state  The state we are processing.
237
     * @return void
238
     */
239
    public static function resumeProcessing($state)
240
    {
241
        assert(is_array($state));
242
243
        while (count($state[self::FILTERS_INDEX]) > 0) {
244
            $filter = array_shift($state[self::FILTERS_INDEX]);
245
            try {
246
                $filter->process($state);
247
            } catch (Error\Exception $e) {
248
                State::throwException($state, $e);
249
            } catch (\Exception $e) {
250
                $e = new Error\UnserializableException($e);
251
                State::throwException($state, $e);
252
            }
253
        }
254
255
        // Completed
256
257
        assert(array_key_exists('ReturnURL', $state) || array_key_exists('ReturnCall', $state));
258
        assert(!array_key_exists('ReturnURL', $state) || !array_key_exists('ReturnCall', $state));
259
260
261
        if (array_key_exists('ReturnURL', $state)) {
262
            /*
263
             * Save state information, and redirect to the URL specified
264
             * in $state['ReturnURL'].
265
             */
266
            $id = State::saveState($state, self::COMPLETED_STAGE);
267
            Utils\HTTP::redirectTrustedURL($state['ReturnURL'], [self::AUTHPARAM => $id]);
268
        } else {
269
            /* Pass the state to the function defined in $state['ReturnCall']. */
270
271
            // We are done with the state array in the session. Delete it.
272
            State::deleteState($state);
273
274
            $func = $state['ReturnCall'];
275
            assert(is_callable($func));
276
277
            call_user_func($func, $state);
0 ignored issues
show
Security Code Execution introduced by
$func can contain request data and is used in code execution context(s) leading to a potential security vulnerability.

14 paths for user data to reach this point

  1. Path: ParameterBag::get() returns request data in vendor/symfony/http-foundation/ParameterBag.php on line 82
  1. ParameterBag::get() returns request data
    in vendor/symfony/http-foundation/ParameterBag.php on line 82
  2. $request->server->get('PATH_INFO') is assigned to $url
    in lib/SimpleSAML/Module.php on line 138
  3. Data is passed through substr(), and substr($url, 1) is assigned to $module
    in lib/SimpleSAML/Module.php on line 149
  4. NotFound::__construct() is called
    in lib/SimpleSAML/Module.php on line 157
  5. Enters via parameter $reason
    in lib/SimpleSAML/Error/NotFound.php on line 32
  6. Error::__construct() is called
    in lib/SimpleSAML/Error/NotFound.php on line 42
  7. Enters via parameter $errorCode
    in lib/SimpleSAML/Error/Error.php on line 81
  8. $errorCode is assigned to property Error::$errorCode
    in lib/SimpleSAML/Error/Error.php on line 91
  9. Read from property Error::$errorCode, and $this->errorCode is returned
    in lib/SimpleSAML/Error/Error.php on line 125
  10. $e->getErrorCode() is assigned to $errorCode
    in modules/core/www/loginuserpass.php on line 87
  11. array('code' => $errorCode, 'params' => $errorParams) is assigned to $state
    in modules/core/www/loginuserpass.php on line 89
  12. State::saveState() is called
    in modules/core/www/loginuserpass.php on line 93
  13. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  14. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  15. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  16. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  17. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  18. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  19. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  20. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  21. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  22. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  23. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  24. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  25. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  26. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  2. Path: Read tainted data from array, and $_SERVER['HTTP_HOST'] is assigned to $current in lib/SimpleSAML/Utils/HTTP.php on line 64
  1. Read tainted data from array, and $_SERVER['HTTP_HOST'] is assigned to $current
    in lib/SimpleSAML/Utils/HTTP.php on line 64
  2. $current is returned
    in lib/SimpleSAML/Utils/HTTP.php on line 80
  3. self::getServerHost() is assigned to $hostname
    in lib/SimpleSAML/Utils/HTTP.php on line 853
  4. $protocol . '://' . $hostname . $port . $_SERVER['REQUEST_URI'] is returned
    in lib/SimpleSAML/Utils/HTTP.php on line 856
  5. SimpleSAML\Utils\HTTP::getSelfURL() is assigned to $url
    in lib/SimpleSAML/Error/NotFound.php on line 36
  6. Error::__construct() is called
    in lib/SimpleSAML/Error/NotFound.php on line 42
  7. Enters via parameter $errorCode
    in lib/SimpleSAML/Error/Error.php on line 81
  8. $errorCode is assigned to property Error::$errorCode
    in lib/SimpleSAML/Error/Error.php on line 91
  9. Read from property Error::$errorCode, and $this->errorCode is returned
    in lib/SimpleSAML/Error/Error.php on line 125
  10. $e->getErrorCode() is assigned to $errorCode
    in modules/core/www/loginuserpassorg.php on line 112
  11. array('code' => $errorCode, 'params' => $errorParams) is assigned to $state
    in modules/core/www/loginuserpassorg.php on line 114
  12. State::saveState() is called
    in modules/core/www/loginuserpassorg.php on line 119
  13. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  14. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  15. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  16. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  17. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  18. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  19. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  20. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  21. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  22. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  23. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  24. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  25. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  26. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  3. Path: Read from $_GET, and Data is passed through checkURLAllowed(), and IdP::doLogoutRedirect() is called in www/saml2/idp/initSLO.php on line 15
  1. Read from $_GET, and Data is passed through checkURLAllowed(), and IdP::doLogoutRedirect() is called
    in www/saml2/idp/initSLO.php on line 15
  2. Enters via parameter $url
    in lib/SimpleSAML/IdP.php on line 548
  3. array('Responder' => array('\SimpleSAML\IdP', 'finishLogoutRedirect'), 'core:Logout:URL' => $url) is assigned to $state
    in lib/SimpleSAML/IdP.php on line 552
  4. IdP::handleLogoutRequest() is called
    in lib/SimpleSAML/IdP.php on line 557
  5. Enters via parameter $state
    in lib/SimpleSAML/IdP.php on line 484
  6. $this->id is assigned to $state
    in lib/SimpleSAML/IdP.php on line 489
  7. State::saveState() is called
    in lib/SimpleSAML/IdP.php on line 499
  8. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  9. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  10. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  11. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  12. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  13. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  14. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  15. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  16. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  17. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  18. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  19. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  20. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  21. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  4. Path: Session::setData() is called in lib/SimpleSAML/Auth/State.php on line 220
  1. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  2. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  3. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  4. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  5. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  6. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  7. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  8. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  9. SimpleSAML\Auth\State::loadState($_REQUEST['AuthState'], 'core:Logout:afterbridge') is assigned to $state
    in modules/saml/www/proxy/invalid_session.php on line 24
  10. IdP::getById() is called
    in modules/saml/www/proxy/invalid_session.php on line 27
  11. Enters via parameter $id
    in lib/SimpleSAML/IdP.php on line 131
  12. IdP::__construct() is called
    in lib/SimpleSAML/IdP.php on line 139
  13. Enters via parameter $id
    in lib/SimpleSAML/IdP.php on line 69
  14. $id is assigned to property IdP::$id
    in lib/SimpleSAML/IdP.php on line 71
  15. Read from property IdP::$id, and $this->id is assigned to $state
    in lib/SimpleSAML/IdP.php on line 489
  16. IFrameLogoutHandler::startLogout() is called
    in lib/SimpleSAML/IdP.php on line 506
  17. Enters via parameter $state
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 47
  18. State::saveState() is called
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 76
  19. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  20. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  21. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  22. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  23. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  24. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  25. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  26. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  27. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  28. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  29. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  30. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  31. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  32. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  5. Path: Read from $_REQUEST, and Data is passed through checkURLAllowed(), and IdP::doLogoutRedirect() is called in www/saml2/idp/SingleLogoutService.php on line 20
  1. Read from $_REQUEST, and Data is passed through checkURLAllowed(), and IdP::doLogoutRedirect() is called
    in www/saml2/idp/SingleLogoutService.php on line 20
  2. Enters via parameter $url
    in lib/SimpleSAML/IdP.php on line 548
  3. array('Responder' => array('\SimpleSAML\IdP', 'finishLogoutRedirect'), 'core:Logout:URL' => $url) is assigned to $state
    in lib/SimpleSAML/IdP.php on line 552
  4. IdP::handleLogoutRequest() is called
    in lib/SimpleSAML/IdP.php on line 557
  5. Enters via parameter $state
    in lib/SimpleSAML/IdP.php on line 484
  6. State::saveState() is called
    in lib/SimpleSAML/IdP.php on line 499
  7. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  8. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  9. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  10. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  11. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  12. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  13. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  14. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  15. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  16. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  17. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  18. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  19. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  20. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  6. Path: Read tainted data from array, and Data is passed through substr(), and substr($_SERVER['PATH_INFO'], 1) is assigned to $sourceId in modules/saml/www/sp/saml2-acs.php on line 11
  1. Read tainted data from array, and Data is passed through substr(), and substr($_SERVER['PATH_INFO'], 1) is assigned to $sourceId
    in modules/saml/www/sp/saml2-acs.php on line 11
  2. array('saml:sp:isUnsolicited' => true, 'saml:sp:AuthId' => $sourceId, 'saml:sp:RelayState' => SimpleSAML\Utils\HTTP::checkURLAllowed($spMetadata->getString('RelayState', $response->getRelayState()))) is assigned to $state
    in modules/saml/www/sp/saml2-acs.php on line 126
  3. State::throwException() is called
    in modules/saml/www/sp/saml2-acs.php on line 166
  4. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 356
  5. State::saveState() is called
    in lib/SimpleSAML/Auth/State.php on line 363
  6. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  7. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  8. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  9. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  10. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  11. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  12. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  13. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  14. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  15. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  16. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  17. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  18. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  19. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  7. Path: Read from $_REQUEST, and (string)$_REQUEST['RelayState'] is assigned to $relayState in modules/core/www/idp/logout-iframe-post.php on line 16
  1. Read from $_REQUEST, and (string)$_REQUEST['RelayState'] is assigned to $relayState
    in modules/core/www/idp/logout-iframe-post.php on line 16
  2. Message::setRelayState() is called
    in modules/core/www/idp/logout-iframe-post.php on line 58
  3. Enters via parameter $relayState
    in vendor/simplesamlphp/saml2/src/SAML2/Message.php on line 439
  4. $relayState is assigned to property LogoutRequest::$relayState
    in vendor/simplesamlphp/saml2/src/SAML2/Message.php on line 443
  5. Read from property LogoutRequest::$relayState, and $this->relayState is returned
    in vendor/simplesamlphp/saml2/src/SAML2/Message.php on line 429
  6. array('Responder' => array('\SimpleSAML\Module\saml\IdP\SAML2', 'sendLogoutResponse'), 'saml:SPEntityId' => $spEntityId, 'saml:RelayState' => $message->getRelayState(), 'saml:RequestId' => $message->getId()) is assigned to $state
    in modules/saml/lib/IdP/SAML2.php on line 663
  7. IdP::handleLogoutRequest() is called
    in modules/saml/lib/IdP/SAML2.php on line 671
  8. Enters via parameter $state
    in lib/SimpleSAML/IdP.php on line 484
  9. $this->id is assigned to $state
    in lib/SimpleSAML/IdP.php on line 489
  10. IFrameLogoutHandler::startLogout() is called
    in lib/SimpleSAML/IdP.php on line 506
  11. Enters via parameter $state
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 47
  12. $associations is assigned to $state
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 62
  13. State::saveState() is called
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 76
  14. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  15. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  16. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  17. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  18. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  19. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  20. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  21. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  22. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  23. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  24. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  25. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  26. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  27. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  8. Path: Read tainted data from array, and $protocol . '://' . $hostname . $port . $_SERVER['REQUEST_URI'] is returned in lib/SimpleSAML/Utils/HTTP.php on line 856
  1. Read tainted data from array, and $protocol . '://' . $hostname . $port . $_SERVER['REQUEST_URI'] is returned
    in lib/SimpleSAML/Utils/HTTP.php on line 856
  2. SimpleSAML\Utils\HTTP::getSelfURL() is assigned to $url
    in lib/SimpleSAML/Error/NotFound.php on line 36
  3. Error::__construct() is called
    in lib/SimpleSAML/Error/NotFound.php on line 42
  4. Enters via parameter $errorCode
    in lib/SimpleSAML/Error/Error.php on line 81
  5. $errorCode is assigned to property Error::$errorCode
    in lib/SimpleSAML/Error/Error.php on line 91
  6. Read from property Error::$errorCode, and $this->errorCode is returned
    in lib/SimpleSAML/Error/Error.php on line 125
  7. $e->getErrorCode() is assigned to $errorCode
    in modules/core/www/loginuserpass.php on line 87
  8. array('code' => $errorCode, 'params' => $errorParams) is assigned to $state
    in modules/core/www/loginuserpass.php on line 89
  9. State::saveState() is called
    in modules/core/www/loginuserpass.php on line 93
  10. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  11. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  12. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  13. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  14. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  15. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  16. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  17. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  18. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  19. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  20. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  21. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  22. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  23. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  9. Path: Session::setData() is called in modules/multiauth/lib/Auth/Source/MultiAuth.php on line 211
  1. Session::setData() is called
    in modules/multiauth/lib/Auth/Source/MultiAuth.php on line 211
  2. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  3. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  4. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  5. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  6. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  7. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  8. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  9. SimpleSAML\Auth\State::loadState($authStateId, SimpleSAML\Module\multiauth\Auth\Source\MultiAuth::STAGEID) is assigned to $state
    in modules/multiauth/www/selectsource.php on line 20
  10. $state['multiauth:preselect'] is assigned to $source
    in modules/multiauth/www/selectsource.php on line 49
  11. MultiAuth::delegateAuthentication() is called
    in modules/multiauth/www/selectsource.php on line 50
  12. Enters via parameter $authId
    in modules/multiauth/lib/Auth/Source/MultiAuth.php on line 186
  13. Session::setData() is called
    in modules/multiauth/lib/Auth/Source/MultiAuth.php on line 211
  14. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  15. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  16. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  17. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  18. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  19. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  20. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  21. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  22. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  23. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  24. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  10. Path: ConfigurationError::__construct() is called in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 64
  1. ConfigurationError::__construct() is called
    in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 64
  2. Enters via parameter $reason
    in lib/SimpleSAML/Error/ConfigurationError.php on line 38
  3. $reason is assigned to property ConfigurationError::$reason
    in lib/SimpleSAML/Error/ConfigurationError.php on line 52
  4. Read from property ConfigurationError::$reason, and $this->reason is returned
    in lib/SimpleSAML/Error/ConfigurationError.php on line 66
  5. $exception->getReason() is assigned to $reason
    in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 78
  6. CriticalConfigurationError::__construct() is called
    in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 83
  7. Enters via parameter $reason
    in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 52
  8. ConfigurationError::__construct() is called
    in lib/SimpleSAML/Error/CriticalConfigurationError.php on line 64
  9. Enters via parameter $reason
    in lib/SimpleSAML/Error/ConfigurationError.php on line 38
  10. $reason is assigned to $params
    in lib/SimpleSAML/Error/ConfigurationError.php on line 49
  11. Error::__construct() is called
    in lib/SimpleSAML/Error/ConfigurationError.php on line 54
  12. Enters via parameter $errorCode
    in lib/SimpleSAML/Error/Error.php on line 81
  13. $errorCode is assigned to property Error::$errorCode
    in lib/SimpleSAML/Error/Error.php on line 91
  14. Read from property Error::$errorCode, and $this->errorCode is returned
    in lib/SimpleSAML/Error/Error.php on line 125
  15. $e->getErrorCode() is assigned to $errorCode
    in modules/core/www/loginuserpass.php on line 87
  16. array('code' => $errorCode, 'params' => $errorParams) is assigned to $state
    in modules/core/www/loginuserpass.php on line 89
  17. State::saveState() is called
    in modules/core/www/loginuserpass.php on line 93
  18. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  19. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  20. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  21. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  22. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  23. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  24. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  25. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  26. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  27. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  28. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  29. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  30. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  31. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  11. Path: Read from $_REQUEST, and (string)$_REQUEST['idp'] is assigned to $idp in modules/core/www/idp/logout-iframe-post.php on line 6
  1. Read from $_REQUEST, and (string)$_REQUEST['idp'] is assigned to $idp
    in modules/core/www/idp/logout-iframe-post.php on line 6
  2. IdP::getById() is called
    in modules/core/www/idp/logout-iframe-post.php on line 7
  3. Enters via parameter $id
    in lib/SimpleSAML/IdP.php on line 131
  4. IdP::__construct() is called
    in lib/SimpleSAML/IdP.php on line 139
  5. Enters via parameter $id
    in lib/SimpleSAML/IdP.php on line 69
  6. $id is assigned to property IdP::$id
    in lib/SimpleSAML/IdP.php on line 71
  7. Read from property IdP::$id, and $this->id is assigned to $state
    in lib/SimpleSAML/IdP.php on line 489
  8. IFrameLogoutHandler::startLogout() is called
    in lib/SimpleSAML/IdP.php on line 506
  9. Enters via parameter $state
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 47
  10. $associations is assigned to $state
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 62
  11. State::saveState() is called
    in lib/SimpleSAML/IdP/IFrameLogoutHandler.php on line 76
  12. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  13. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  14. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  15. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  16. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  17. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  18. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  19. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  20. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  21. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  22. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  23. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  24. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  25. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  12. Path: Read tainted data from array, and Data is passed through substr(), and self::getBaseURL() . $url_path . substr($_SERVER['REQUEST_URI'], $uri_pos + strlen($url_path)) is returned in lib/SimpleSAML/Utils/HTTP.php on line 859
  1. Read tainted data from array, and Data is passed through substr(), and self::getBaseURL() . $url_path . substr($_SERVER['REQUEST_URI'], $uri_pos + strlen($url_path)) is returned
    in lib/SimpleSAML/Utils/HTTP.php on line 859
  2. SimpleSAML\Utils\HTTP::getSelfURL() is assigned to $url
    in lib/SimpleSAML/Error/NotFound.php on line 36
  3. Error::__construct() is called
    in lib/SimpleSAML/Error/NotFound.php on line 42
  4. Enters via parameter $errorCode
    in lib/SimpleSAML/Error/Error.php on line 81
  5. $errorCode is assigned to property Error::$errorCode
    in lib/SimpleSAML/Error/Error.php on line 91
  6. Read from property Error::$errorCode, and $this->errorCode is returned
    in lib/SimpleSAML/Error/Error.php on line 125
  7. $e->getErrorCode() is assigned to $errorCode
    in modules/core/www/loginuserpassorg.php on line 112
  8. array('code' => $errorCode, 'params' => $errorParams) is assigned to $state
    in modules/core/www/loginuserpassorg.php on line 114
  9. State::saveState() is called
    in modules/core/www/loginuserpassorg.php on line 119
  10. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  11. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  12. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  13. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  14. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  15. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  16. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  17. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  18. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  19. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  20. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  21. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  22. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  23. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  13. Path: ProcessingChain::resumeProcessing() is called in modules/core/lib/Controller/Exception.php on line 156
  1. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  2. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  3. State::saveState() is called
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 266
  4. Enters via parameter $state
    in lib/SimpleSAML/Auth/State.php on line 205
  5. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  6. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  7. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  8. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  9. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  10. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  11. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  12. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  13. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  14. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  15. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  16. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  17. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274
  14. Path: Read from $_SERVER in lib/SimpleSAML/Utils/HTTP.php on line 119
  1. Read from $_SERVER
    in lib/SimpleSAML/Utils/HTTP.php on line 119
  2. State::saveState() is called
    in modules/core/lib/Auth/UserPassOrgBase.php on line 225
  3. Enters via parameter $stage
    in lib/SimpleSAML/Auth/State.php on line 205
  4. $stage is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 215
  5. Data is passed through serialize(), and serialize($state) is assigned to $serializedState
    in lib/SimpleSAML/Auth/State.php on line 218
  6. Session::setData() is called
    in lib/SimpleSAML/Auth/State.php on line 220
  7. Enters via parameter $data
    in lib/SimpleSAML/Session.php on line 888
  8. array('expires' => $expires, 'timeout' => $timeout, 'data' => $data) is assigned to $dataInfo
    in lib/SimpleSAML/Session.php on line 913
  9. $dataInfo is assigned to property Session::$dataStore
    in lib/SimpleSAML/Session.php on line 923
  10. Read from property Session::$dataStore, and $this->dataStore[$type][$id]['data'] is returned
    in lib/SimpleSAML/Session.php on line 980
  11. $session->getData('\SimpleSAML\Auth\State', $sid['id']) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 280
  12. Data is passed through unserialize(), and unserialize($state) is assigned to $state
    in lib/SimpleSAML/Auth/State.php on line 295
  13. $state is returned
    in lib/SimpleSAML/Auth/State.php on line 319
  14. SimpleSAML\Auth\State::loadState($stateId, 'core:short_sso_interval') is assigned to $state
    in modules/core/lib/Controller/Exception.php on line 151
  15. ProcessingChain::resumeProcessing() is called
    in modules/core/lib/Controller/Exception.php on line 156
  16. Enters via parameter $state
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 239
  17. $state['ReturnCall'] is assigned to $func
    in lib/SimpleSAML/Auth/ProcessingChain.php on line 274

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
278
            assert(false);
279
        }
280
    }
281
282
283
    /**
284
     * Process the given state passivly.
285
     *
286
     * Modules with user interaction are expected to throw an \SimpleSAML\Module\saml\Error\NoPassive exception
287
     * which are silently ignored. Exceptions of other types are passed further up the call stack.
288
     *
289
     * This function will only return if processing completes.
290
     *
291
     * @param array &$state  The state we are processing.
292
     * @return void
293
     */
294
    public function processStatePassive(&$state)
295
    {
296
        assert(is_array($state));
297
        // Should not be set when calling this method
298
        assert(!array_key_exists('ReturnURL', $state));
299
300
        // Notify filters about passive request
301
        $state['isPassive'] = true;
302
303
        $state[self::FILTERS_INDEX] = $this->filters;
304
305
        // TODO: remove this in SSP 2.0
306
        if (!array_key_exists('UserID', $state)) {
307
            // No unique user ID present. Attempt to add one.
308
            self::addUserID($state);
309
        }
310
311
        while (count($state[self::FILTERS_INDEX]) > 0) {
312
            $filter = array_shift($state[self::FILTERS_INDEX]);
313
            try {
314
                $filter->process($state);
315
            } catch (Error\NoPassive $e) {
316
                // @deprecated will be removed in 2.0
317
                // Ignore \SimpleSAML\Error\NoPassive exceptions
318
            } catch (Module\saml\Error\NoPassive $e) {
319
                // Ignore \SimpleSAML\Module\saml\Error\NoPassive exceptions
320
            }
321
        }
322
    }
323
324
    /**
325
     * Retrieve a state which has finished processing.
326
     *
327
     * @param string $id The state identifier.
328
     * @see State::parseStateID()
329
     * @return array|null The state referenced by the $id parameter.
330
     */
331
    public static function fetchProcessedState($id)
332
    {
333
        assert(is_string($id));
334
335
        return State::loadState($id, self::COMPLETED_STAGE);
336
    }
337
338
339
    /**
340
     * @deprecated This method will be removed in SSP 2.0.
341
     * @param array &$state
342
     * @return void
343
     */
344
    private static function addUserID(array &$state)
345
    {
346
        assert(array_key_exists('Attributes', $state));
347
348
        if (isset($state['Destination']['userid.attribute'])) {
349
            $attributeName = $state['Destination']['userid.attribute'];
350
            Logger::debug("The 'userid.attribute' option has been deprecated.");
351
        } elseif (isset($state['Source']['userid.attribute'])) {
352
            $attributeName = $state['Source']['userid.attribute'];
353
            Logger::debug("The 'userid.attribute' option has been deprecated.");
354
        } else {
355
            // Default attribute
356
            $attributeName = 'eduPersonPrincipalName';
357
        }
358
359
        if (!array_key_exists($attributeName, $state['Attributes'])) {
360
            return;
361
        }
362
363
        $uid = $state['Attributes'][$attributeName];
364
        if (count($uid) === 0) {
365
            Logger::warning('Empty user id attribute [' . $attributeName . '].');
366
            return;
367
        }
368
369
        if (count($uid) > 1) {
370
            Logger::warning('Multiple attribute values for user id attribute [' . $attributeName . '].');
371
            return;
372
        }
373
374
        // TODO: the attribute value should be trimmed
375
        $uid = $uid[0];
376
377
        if (empty($uid)) {
378
            Logger::warning('Empty value in attribute ' . $attributeName . ". on user. Cannot set UserID.");
379
            return;
380
        }
381
        $state['UserID'] = $uid;
382
    }
383
}
384