Skip to content

Commit 685350f

Browse files
tomaioomejo-
authored andcommitted
fix(security): clamp limit parameter in user search
The `index(string $filter = '', int $limit = 5)` method accepts client-controlled `limit` and passes it directly to collaborator search. Without an upper bound, an attacker can request very large limits, causing expensive directory lookups and increased response size. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
1 parent 86063a0 commit 685350f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/Controller/UserApiController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(
3737
#[NoAdminRequired]
3838
#[RequireDocumentSession]
3939
public function index(string $filter = '', int $limit = 5): DataResponse {
40+
$limit = min($limit, 50);
4041
$sessions = $this->sessionService->getAllSessions($this->getSession()->getDocumentId());
4142

4243
$users = [];

0 commit comments

Comments
 (0)