GHSA-MRRJ-4F5X-J958
CSRF token check bypass in the user administration allows privilege escalation
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MRRJ-4F5X-J958 divulgada · CVSS 8.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
The backend user administration (`page=users/users`) ran its CSRF check behind a condition that the write path itself did not share. A request could therefore reach the update path without a valid token.
The attack works as a plain GET request, so it was enough for a backend user with the `users[]` permission to open an attacker-controlled page while logged in. Depending on the parameters, this modified arbitrary user accounts — granting administrator rights, deactivating accounts, or locking the only administrator out of the backend.
Root cause
Saving a user in the backend covers three write paths: create, update and delete. The CSRF check for the create and update paths was bound to an additional condition — it only ran when the `save` parameter was truthy and one of the function actions was requested:
if ($save && ($fUNCADD || $fUNCUPDATE || $fUNCAPPLY)) {
if (!rex_csrf_token::factory('user_edit')->isValid()) {
$warnings[] = rex_i18n::msg('csrf_token_invalid');
}
// …
}The update itself, however, was triggered by `FUNC_UPDATE` or `FUNC_APPLY` alone and did not require `save`:
if ($warnings) {
// do not save
} elseif ('' != $fUNCUPDATE || '' != $fUNCAPPLY) {
// writes to the user record
}Both conditions could be decoupled: a request carrying `FUNC_UPDATE=1` without `save` skipped the token check entirely, produced no warning, and still entered the unprotected update path.
The create path (`FUNC_ADD`) was not affected — it required `save` explicitly (`'' != $fUNCADD && 1 == $save`), so the token check always ran before it. That explicit condition was missing on the update path.
Why a GET request was sufficient
The parameters were read through `rex_request()`, which resolves against `$_REQUEST` and therefore covers both GET and POST. No form and no JavaScript were needed — a link was enough:
https://example.org/redaxo/index.php?page=users/users&user_id=3&FUNC_UPDATE=1&useradmin=1&userstatus=1GET /redaxo/index.php?page=users/users&user_id=3&FUNC_UPDATE=1&useradmin=1&userstatus=1 HTTP/1.1
Host: example.org
Cookie: PHPSESSID=<session-of-the-logged-in-user>REDAXO's session cookie defaults to `SameSite=Lax`, which still sends the cookie on a top-level GET navigation. An attacker page performing `window.location = …` was enough to carry out the request in the victim's authenticated session.
Why the existing permission guard did not help
Before reading `FUNC_UPDATE`, the page restricts editing to cases where the logged-in account is an administrator or the target account is not:
if (0 !== $userId && ($currentUser->isAdmin() || !$user->isAdmin())) {In a CSRF scenario the logged-in account is the victim, so this check was evaluated in the victim's favour and did not prevent the attack.
Impact
Privilege escalation. With `useradmin=1` in the request, the target account received the administrator flag. An attacker holding a low-privileged backend account could escalate that account by getting an administrator to open a prepared link. A set admin flag overrides all role assignments.
Account deactivation. `userstatus` defaults to inactive when the parameter is absent, so a request without it disabled the target account and prevented the user from logging in. This variant required no administrator victim — any logged-in user with the `users[]` permission was sufficient, as long as the target was not an administrator.
Administrator lockout. Pointing the request at the victim's own account kept the admin flag (a separate guard prevents administrators from removing it from themselves) but did not cover the status, so the account was set to inactive. On installations with a single administrator this locked the backend, recoverable only through direct server access — resetting the status in the database or creating a new administrator via `redaxo/bin/console user:create`.
Collateral damage. Parameters missing from the request were written with their defaults, so role assignments, name and email of the target account were cleared as a side effect.
Passwords could not be set through this path: `userpsw` is read via `rex_post()` and is therefore not reachable with a GET request.
Patch
Fixed in 5.21.3. The token check no longer depends on `save` for the update path:
if ($fUNCUPDATE || $fUNCAPPLY || ($fUNCADD && $save)) {`FUNC_UPDATE` and `FUNC_APPLY` are only ever sent by the submit buttons of the edit form, so requiring a valid token for them unconditionally is safe. `FUNC_ADD` keeps its `save` condition because it is also used to open the empty create form, which legitimately arrives without a token.
Credits
Reported by @V-C-Williams https://github.com/V-C-Williams.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistredaxo/source |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/redaxo/core/security/advisories/GHSA-mrrj-4f5x-j958Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
