Advisory

GHSA-6rvw-7p8v-mjfq

Details, part 2 of 2. The advisory

Details

```php
require_once $global['systemRootPath'] . 'objects/user.php';
User::loginCheck(); // reject anonymous callers
if (!canSearchUsers()) {
header('HTTP/1.1 403 Forbidden');
die('{"error":"forbidden"}');
}
```

  1. Remove the isCompany-driven $ignoreAdmin = true branch (users.json.php:41-48). It served no purpose that the explicit canSearchUsers() check above does not already cover, and its only observable effect is the bypass described here.
  1. Gate the users_id path behind the same check, or restrict its output to the caller’s own record when the caller is not an admin:

```php
if (!empty($_REQUEST['users_id'])) {
$requestedId = intval($_REQUEST['users_id']);
if (!canSearchUsers() && $requestedId !== User::getId()) {
header('HTTP/1.1 403 Forbidden');
die('{"error":"forbidden"}');
}
$user = User::getUserFromID($requestedId);
...
}
```

  1. Consider clamping $_REQUEST['rowCount'] to a sane ceiling (e.g. 100) and removing objects/users.json.php from the CSRF-bypass list in objects/functionsSecurity.php:893 unless there is a specific mobile-client requirement — and if there is, route it through an authenticated API token instead of making the endpoint anonymously reachable.

Sources & licences