Skip to content

Commit e2aff18

Browse files
committed
Bug in client's scope restriction
If set `scope` column in `oauth_clients` table to empty string, then client allowed to any scope even if it not exists in `oauth_scopes` table.
1 parent d0b7989 commit e2aff18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OAuth2/Controller/AuthorizeController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ public function validateAuthorizeRequest(RequestInterface $request, ResponseInte
236236
// restrict scope by client specific scope if applicable,
237237
// otherwise verify the scope exists
238238
$clientScope = $this->clientStorage->getClientScope($client_id);
239-
if ((is_null($clientScope) && !$this->scopeUtil->scopeExists($requestedScope))
240-
|| ($clientScope && !$this->scopeUtil->checkScope($requestedScope, $clientScope))) {
239+
if ((empty($clientScope) && !$this->scopeUtil->scopeExists($requestedScope))
240+
|| (!empty($clientScope) && !$this->scopeUtil->checkScope($requestedScope, $clientScope))) {
241241
$response->setRedirect($this->config['redirect_status_code'], $redirect_uri, $state, 'invalid_scope', 'An unsupported scope was requested', null);
242242

243243
return false;

0 commit comments

Comments
 (0)