llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · egroupware/egroupware

GHSA-76Q5-2JM8-X8C3

Authorization bypass via api./about. menuaction prefix → privilege escalation to administrator (account takeover, chainable to RCE)

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS
—
critical
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versiones23.1.20260710 · 26.7.20260710
Exposición98 dDesde la divulgación, 14 ago 2026, 6:27 a. m.
Detección96 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
14 ago 26
17 ago 26
18 nov 26
21 nov 26
14 ago 26
8 sept 26
2 oct 26
27 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-76Q5-2JM8-X8C3 divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

[CRITICAL] Authorization bypass via `api.`/`about` menuaction prefix → privilege escalation to admin (account takeover)

  • CWE: CWE-863 Incorrect Authorization (primary); CWE-269 Improper Privilege Management; CWE-306 Missing Authorization on the reachable admin AJAX method.
  • CVSS v3.1: `AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H` = 9.6 Critical
  • Affected component:
  • Root cause: `api/src/Egw.php::check_app_rights()` line 393 — the app-membership gate is skipped for `currentapp ∈ {api, about}`.
  • Dispatcher: `api/src/Json/Request.php::parseRequest()` lines 182–206 — the only gate is the "class or function name must start/end with `ajax`" rule; there is no `public_functions` check and class resolution (`class_exists($className)`) is by class name, independent of the menuaction's app.
  • Autoloader: `api/src/autoload.php` (legacy loader, ~line 74) maps `admin_passwordreset` → `admin/inc/class.admin_passwordreset.inc.php` regardless of the `appName`.
  • Confirmed sink: `admin/inc/class.admin_passwordreset.inc.php::ajax_reset()` (line 394) → `resetAccount()` (line 186) → `Api\Accounts::set_memberships()` (`api/src/Accounts.php:1103`, no ACL check).

## Summary
Every non-login EGroupware request runs `Egw::check_app_rights()`, the single gate that enforces
"user has the app the menuaction targets". It deliberately exempts the `api` and `about` apps
("give everyone implicit api rights"). Because `json.php` derives `currentapp` from the **first
dotted component of the client-supplied `menuaction`**, an attacker sets that component to `api`
while naming an admin class as the second component. The class is autoloaded by name (from
`admin/`), so the admin AJAX method executes with the admin app-gate skipped.

The concrete Critical exploit targets `admin_passwordreset::ajax_reset`, which:
- is not protected by an eTemplate CSRF token (`csrfCheck`), unlike sibling methods
`admin_account::ajax_delete_group`, `admin_acl::ajax_change_acl`, `admin_customfields::ajax_delete_type`;
- has a fail-open constructor guard: `if($GLOBALS['egw']->acl->check('account_access',16,'admin')) redirect()`
returns `0` (falsy) for a non-admin (they have no `account_access`/`admin` deny row), so the redirect never fires;
- calls `Accounts::set_memberships(existing + $content['values']['group'], $content['user'])`
with fully attacker-controlled `user` and `group`, and `set_memberships` performs no caller-ACL check.

An authenticated regular user therefore adds their own account to the Admins group, becoming a
full administrator in a single request. From admin, OS-level RCE is trivially reachable (e.g. EGW-002
eTemplate `${}` eval, admin remote-command features, or config-driven code paths), so real-world
impact is full server compromise.

## Reachability (hop-by-hop, every guard resolved)
1. Auth: any valid session (a normal non-admin user; or, on installs with self-registration, a
self-created account). CSRF is irrelevant — the attacker calls the endpoint from their own session.
2. `POST /json.php?menuaction=api.admin_passwordreset.ajax_reset`
body: `{"request":{"parameters":[{"user":<ownAccountId>,"values":{"group":[<AdminsGid>]}}]}}`
3. `json.php` parses `appName=api, className=admin_passwordreset, functionName=ajax_reset`; sets
`egw_info[flags][currentapp]=api`.
4. `header.inc.php` → `Egw` bootstrap (`Egw.php:230`) → `check_app_rights()`:
`in_array('api', ['api','about'])` is true → the admin-app membership check is skipped. *(guard bypassed)*
5. `Json\Request::parseRequest`: `functionName='ajax_reset'` starts with `ajax` → the security
name-rule (line 182) passes; the menuaction matches the format regex. There is **no
`public_functions` enforcement** on this path. *(guard bypassed)*
6. `class_exists('admin_passwordreset')` triggers the legacy autoloader → loads the admin class →
`new admin_passwordreset()`. Constructor: `acl->check('account_access',16,'admin')` →
`get_rights` finds no matching deny row for a non-admin → returns `0` → `!!(0 & 16)=false` →
no redirect (fail-open). *(guard bypassed)*
7. `call_user_func_array([$obj,'ajax_reset'], [$content])` → `resetAccount($content['user'],
$content['values'], …)` → `if($content['group']) set_memberships(array_merge(keys(memberships),
$content['group']), $account_id)`. `set_memberships` has no ACL. *(sink reached)*
8. Attacker's account is now a member of the Admins group → full admin. → server RCE.

## Root cause
Authorization is enforced only at the "does the user have app X" layer keyed on the *self-declared*
`currentapp`, while the executed code is chosen by an independent name-based autoloader. The
`api`/`about` exemption, intended to allow shared framework AJAX (`EGroupware\Api\*` helpers), also
matches any `menuaction` whose first component is literally `api`, decoupling the gate from the code
that runs. Per-class guards are inconsistent: some methods use `csrfCheck`, `ajax_reset` uses only a
constructor ACL check that is a deny-mask (fail-open for users who were never granted admin).

## Impact
Authenticated non-admin → full administrator (all users' data, config, mail credentials, groups) →
OS command execution. Complete confidentiality, integrity and availability loss.

## Preconditions
- One authenticated account of any privilege (default installs require login; self-registration, if
enabled, removes even that). No admin role, no CSRF token, default configuration.
- `AdminsGid` is enumerable (well-known default group; also readable via other now-reachable admin
AJAX helpers such as `admin_acl::ajax_get_app_list`, or account-selection widgets).

## Evidence
- `api/src/Egw.php:389-418` — `check_app_rights()`, `in_array(currentapp,['api','about'])` early exempt.
- `api/src/Json/Request.php:182-206` — name-rule only; `class_exists($className) ? new $className()`; no `public_functions`.
- `api/src/autoload.php:73+` — class→file by name prefix (`admin_*` → `admin/inc/class.*`).
- `admin/inc/class.admin_passwordreset.inc.php:53-57` (fail-open ctor), `:394` (`ajax_reset`, no csrfCheck), `:186-192` (`resetAccount` → `set_memberships`).
- `api/src/Accounts.php:1103` — `set_memberships` performs no caller authorization.
- `api/src/Acl.php:244-294` — `get_rights`/`check`: deny-mask semantics; non-admin → 0.

## Proof of Concept (safe, local logic reproduction)
`scratchpad/authz_poc.php` reproduces the four gate predicates against the exact source fragments and
shows all four evaluate "open" for a non-admin: dispatch name-rule ALLOWED, `check_app_rights` SKIPPED
(currentapp=api), constructor `acl->check` = false → PASSES, autoload resolves to the admin file
(present in repo). Output confirms the request `api.admin_passwordreset.ajax_reset` reaches
`resetAccount → set_memberships(existing+[AdminsGid], ownId)`.

No mutating action was taken against any real instance; the PoC only evaluates the authorization
predicates. A full dynamic demonstration (call the endpoint as a fresh non-admin user, observe the
account appear in the Admins group) requires a running instance and is described in prose only, per
the engagement's do-no-harm boundary.

## Adversarial re-read (what I tried to refute it with)
- *Is there a global CSRF/referer check in `json.php`?* No — ajax dispatch requires only a valid
session; the attacker uses their own session, so CSRF does not apply.
- *Does `public_functions` restrict `ajax_reset`?* The JSON path never consults `public_functions`
(verified in `parseRequest`); the class-level `$public_functions` array is not enforced here.
- *Does the constructor actually block non-admins?* No — `account_access`/`admin` is a deny mask
that only admins have rows for; `get_rights` returns 0 for a normal user → check is falsy → no
redirect. Verified against `Acl::get_rights`.
- *Does `set_memberships` re-check authorization?* No — it goes straight to `backend->set_memberships`
(read `api/src/Accounts.php:1103-1122`).
- *Are the safe sibling methods proof the gate is meant to hold at the class layer?*
`admin_account::ajax_delete_group` and `admin_acl::ajax_change_acl` DO call `csrfCheck`, and
`admin_acl` throws `NoPermission` — showing the developers expect the app-gate to protect these,
which the `api.` prefix defeats. `ajax_reset`/`ajax_clear_credentials` were simply left unguarded.
- Result: no concrete blocker survived. CONFIRMED.

## Remediation
1. Bind the executed class to the menuaction's app: after resolving `$className`, verify the class's
owning app (from the autoloader mapping) equals `$appName`, and reject cross-app mismatches; do
not honor an `api.` prefix for a class that physically lives under `admin/`.
2. Do not treat `api`/`about` as a blanket authorization exemption for arbitrary class execution;
restrict the exemption to an allowlist of genuinely public framework endpoints.
3. Make admin AJAX authorization positive and centralized: require `isset($egw_info['user']['apps']['admin'])`
(and the specific `account_access` right) at the top of every admin AJAX method / via a base-class
guard, instead of relying on a fail-open deny-mask constructor.
4. Enforce the eTemplate `csrfCheck` (or an equivalent session-bound CSRF token) on all state-changing
AJAX methods, including `ajax_reset` and `ajax_clear_credentials`.

## Confidence
High (static, PoC-reproduced logic). Every hop verified against source; dynamic confirmation
pending only a running instance.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
egroupware/egroupware< 23.1.20260710
egroupware/egroupware< 26.7.20260710
23.1.20260710
26.7.20260710
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistegroupware/egroupware
Corregida 23.1.20260710, 26.7.20260710 — —
Versiones corregidas23.1.2026071026.7.20260710
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/EGroupware/egroupware/security/advisories/GHSA-76q5-2jm8-x8c3

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.