llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · django-cms

GHSA-VWCW-R26R-22CC

Privilege escalation: delegated CMS administrator can take over a superuser account

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.2
Alta
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -5 d de la divulgación
Exposición101 dDesde la divulgación, 11 ago 2026, 12:26 a. m.
Detección99 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Parche 5.0.10
Monitoreo
Detectada +1
6 ago 26
11 ago 26
18 nov 26
20 nov 26
6 ago 26
1 sept 26
28 sept 26
24 oct 26
20 nov 26
FechaFaseEventoDetalle
Remediación Parche 5.0.10 django-cms · -5 d desde divulgación
Divulgación Publicada GHSA-VWCW-R26R-22CC divulgada · CVSS 7.2 (GitHub)
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

Summary

When the CMS permission system is enabled (`CMS_PERMISSION = True`), a staff user who has been delegated user management rights can change the password of a superuser account through the "Users (page)" admin, and then log in as that superuser. This converts a scoped, delegated administrator into a full site administrator.

Details

django-cms builds a delegation hierarchy on top of Django's admin. `PageUserAdmin` restricts what a delegated administrator may see and do to the set of *subordinate* users returned by `cms.utils.permissions.get_subordinate_users()`.

That function had no notion of superusers being off-limits. At the top of the hierarchy it returned every user in the system:

# cms/utils/permissions.py (before the fix)
if user_level == ROOT_USER_LEVEL:
    return get_user_model().objects.all()   # includes superusers

`ROOT_USER_LEVEL` is reached by any user holding a `GlobalPagePermission` with `can_change_permissions=True` — not just superusers (`get_user_permission_level()`, `cms/utils/permissions.py`).

`PageUserAdmin.get_queryset()` filters on that set, so superuser `PageUser` records appeared in the changelist and were resolvable by `get_object()`.

`PageUserAdmin` did guard the *edit form*: `get_readonly_fields()` adds `is_superuser` to the read-only fields for non-superusers, so a delegated administrator could not grant themselves the superuser flag. But Django's `UserAdmin.user_change_password()` is a separate endpoint (`<id>/password/`) whose only authorisation check is `has_change_permission(request, user)` — which returned `True`, because the superuser was considered a subordinate. The read-only field guard does not apply there.

The two protections were therefore inconsistent: the flag could not be granted, but the account holding it could simply be taken over.

Note the deeper issue is not limited to the password endpoint. Because superusers were in the subordinate queryset, a delegated administrator could also open the superuser's change form and alter its username or email address, opening a second route to takeover via the password reset flow.

Preconditions

All of the following must hold:

  1. `CMS_PERMISSION = True`.
  2. The attacker is an authenticated staff user holding the `cms.change_pageuser` model permission and `GlobalPagePermission(can_change_permissions=True)` (or an equivalent `PagePermission` at a level above the target).
  3. The victim superuser exists as a `PageUser` row. `PageUser` is a multi-table inheritance child of the user model, so accounts created with `createsuperuser` are *not* affected — only superusers created or registered through `/admin/cms/pageuser/`.

Condition 3 is what limits real-world exposure: many deployments never register a superuser as a `PageUser`. Deployments that provision all staff through the CMS user admin are the exposed population.

Proof of concept

With a superuser `PageUser` `victim` and an attacker as described above:

GET  /admin/cms/pageuser/                       -> 200, victim listed
GET  /admin/cms/pageuser/<victim_pk>/change/    -> 200, "change password" link present
GET  /admin/cms/pageuser/<victim_pk>/password/  -> 200
POST /admin/cms/pageuser/<victim_pk>/password/  -> 302, password changed

The attacker then logs in as the superuser. Verified against 5.1.0 with Django 6.0.

Impact

Complete compromise of the Django admin and every application mounted in it: read and write of all CMS content and all other registered models, user and permission administration, and anything else reachable by a superuser. Confidentiality, integrity and availability are all fully impacted.

The attacker must already hold a privileged staff account, so this is an escalation from *delegated administrator* to *full superuser*, not an unauthenticated compromise.

Patches

Two changes, defence in depth:

  1. `cms/utils/permissions.py` — `get_subordinate_users()` A superuser is never subordinate to a non-superuser. All three return paths now exclude `is_superuser=True` rows unless the requesting user is themselves a superuser. This closes the changelist, the change form, the delete view and the password endpoint in one place, because every one of them is queryset-scoped.
  1. `cms/admin/useradmin.py` — `PageUserAdmin` Object-level guards for the case where the queryset is widened again by a subclass or a custom user admin: `has_change_permission()` and `has_delete_permission()` refuse superuser targets for non-superuser requesters, and `user_change_password()` raises `PermissionDenied` before delegating to Django.

After the fix the password endpoint returns 404 to a delegated administrator — the superuser is no longer in the admin's queryset at all, so its existence is not disclosed.

Regression coverage was added in `cms/tests/test_page_user_admin.py` (`SuperuserProtectionTest`, 8 tests) covering the subordinate query, the changelist, the change view, the delete view, the password endpoint, the object-level guards, and
that a genuine superuser retains all of these abilities.

Workarounds

For deployments that cannot upgrade immediately, any one of:

  • Ensure no superuser account exists as a `PageUser` record. Superusers created with `createsuperuser` are not exposed:
  • Revoke the `cms.change_pageuser` permission from all non-superuser staff.
  • Revoke `can_change_permissions` from non-superuser `GlobalPagePermission` records.

References

  • Fix commit: `d32c2020f`
  • `cms/utils/permissions.py` — `get_subordinate_users()`
  • `cms/admin/useradmin.py` — `PageUserAdmin`
  • Django `UserAdmin.user_change_password()` — `django/contrib/auth/admin.py`

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

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:H
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
django-cms≥ 3.0 < 5.0.10
3.0
5.0.10
5.1.3
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypidjango-cms
Corregida 5.0.10 -5 d 5.1.3 no afectada
Versiones corregidas5.0.10
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/django-cms/django-cms/security/advisories/GHSA-vwcw-r26r-22cc

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