GHSA-MGV8-5R6J-2GJQ
Stored XSS in the page delete confirmation view allows privilege escalation from editor to administrator
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 5.1.3 | django-cms · -1 d desde divulgación | |
| Divulgación | Publicada | GHSA-MGV8-5R6J-2GJQ divulgada · CVSS 5.4 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Affected version notes
Verified by inspecting `cms/admin/pageadmin.py` at every release tag. The vulnerable branch was
introduced by df4066639 (“fix: Added the new delete confirmation for pages also to delete
translation”, #8111, 2025-01-30) and is present in every 5.0.x and 5.1.x release.
---
Summary
A user with permission to change pages can store HTML in a page's URL path via the Overwrite URL
field. The page delete confirmation screen renders that value without escaping, so the markup
executes in the browser of any user who opens the confirmation screen for that page — typically an
administrator. This allows an ordinary content editor to escalate to administrator.
Impact
`PageDeleteMessageMixin.get_deleted_objects()` in `cms/admin/pageadmin.py` applies `mark_safe()` to
the display string for related `PageUrl` objects. Because `PageUrl` is not registered in the Django
admin, `django.contrib.admin.utils.get_deleted_objects()` builds that entry as a plain, unescaped
`"%s: %s" % (verbose_name, obj)` string. Marking it safe means the stored path is emitted as markup
by `{{ deleted_objects|unordered_list }}`.
Scripts executing on the admin origin in an administrator's session cannot read the session cookie
(`HttpOnly`), but can read the CSRF token and issue authenticated requests as that administrator —
for example creating a superuser or granting permissions. The practical outcome is full escalation
from editor to administrator.
Who can exploit it: any staff user who can change at least one page. This holds under both
permission models:
- With `CMS_PERMISSION = False` (the shipped default), the Django model permission `cms.change_page`
- With `CMS_PERMISSION = True`, a user granted change rights on a page via `PagePermission` can
Who is affected: any user with delete permission on the poisoned page who opens its delete
confirmation screen.
Scope of the sink. Only the `PageAdmin` delete confirmation
(`/admin/cms/page/<id>/delete/`) renders the vulnerable entry. The `PageContentAdmin` delete view
(deleting a translation) does not, because `PageUrl` relates to `Page` rather than `PageContent` and
is therefore absent from the collected objects. The changelist `delete_selected` action is not
exposed on these admins.
Attack scenario
- An editor sets a page's Overwrite URL to a value containing markup and no `/`, such as
- The editor can make the page an attractive deletion target, for example by creating a page that
- An administrator opens the page's delete confirmation screen — a mandatory step before deleting a
A second route stores the payload on the home page, where `ChangePageForm.clean()` returned
early and never validated the value. It is ignored while the page is the home page, but becomes the
live `PageUrl.path` as soon as another page is made the home page.
Patches
Two changes, defence in depth:
- Output encoding (the fix). `PageDeleteMessageMixin.get_deleted_objects()` no longer marks the
- Input validation (hardening). A page path with no `/` is now validated instead of skipped, and
Upgrading is required even if no editor is untrusted today. Input validation does not clean
values already stored in the database, and paths written through `cms.api` or a direct model save
never pass through the form at all. Only the output-encoding change protects those rows.
Workarounds
None that preserve functionality. Operators who cannot upgrade immediately can limit who holds
`cms.change_page` (or `PagePermission` change rights) to fully trusted users, and audit existing
data for stored markup:
from cms.models import PageUrl
PageUrl.objects.filter(path__regex=r"[<>]")References
- Vulnerable code: `cms/admin/pageadmin.py`, `PageDeleteMessageMixin.get_deleted_objects()`
- Introduced in: df4066639 (#8111)
- Fix commit / PR: #8888
Credits
Reported by Tao Xu (许涛).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypidjango-cms |
Corregida | 5.1.3 | -1 d | 5.1.3 no afectada |
5.1.3Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/django-cms/django-cms/security/advisories/GHSA-mgv8-5r6j-2gjqLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
