PT-2026-151114
Publicado
2026-11-18
·
Atualizado
2026-11-18
Descrição por
CVSS 3.1
6.5
MédiaMétricasAV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H
Summary
The
discard and edit redirect version transitions did not enforce a per-object change-permission check, while the sibling transitions (archive, publish, unpublish, revert) all did. As a result a low-privileged staff user could discard (delete) any draft version — and thereby the underlying content object — of content they have no change permission on, and could create an editable draft off any published version, by supplying a version primary key they should not have access to (an insecure direct object reference).Details
Version state transitions are guarded by
Conditions objects declared on djangocms versioning.models.Version. Every transition that mutates content carries the user can change condition, which delegates to the content object's own permission check (Version.has change permission → content.has change permission / has placeholder change permission, with a final fallback to the Django change <model> permission).Two conditions were missing that check:
python
# Before (vulnerable)
check discard = Conditions([
in state([constants.DRAFT], not draft error),
is not locked(lock error message),
])
check edit redirect = Conditions([
in state([constants.DRAFT, constants.PUBLISHED], ("Version is not in draft or published state")),
draft is not locked(lock draft error message),
])The corresponding admin views authorize only through these conditions:
VersionAdmin.discard view/VersionAdmin.edit redirect viewfetch the target with the stockModelAdmin.get object, which is backed by the unfiltered default queryset — no per-user or per-grouper scoping.- The views are registered with
admin site.admin view, which enforces onlyis staff. discard viewdeletes the version directly viaversion.delete()and never consultsVersionAdmin.has delete permission(which otherwise delegates to the content admin and honorsALLOW DELETING VERSIONS).
Because the only per-object gate for these two operations was the
Conditions list, and that list omitted user can change, any staff user could invoke the operation on any version by its primary key. The changelist action buttons are disabled in the UI via check discard.as bool / check edit redirect.as bool, but that is a client-side affordance only and does not protect the directly reachable admin URLs.Impact
- Type: Broken access control / missing authorization (IDOR).
- Who is affected: Multi-editor deployments where staff users hold differentiated per-object permissions.
- Under
CMS PERMISSION = True, authorization for these two operations was effectively reduced tois staff, so any staff user could discard or edit-redirect any version. - Under the default
CMS PERMISSION = False, it degrades to the globalchange <model>permission (e.g.cms.change page) — weaker than the intended per-object check, but not absent. - Consequence: Unauthorized deletion of draft versions and their content objects (integrity/availability of content), and unauthorized creation of drafts from published content.
Patches
Fixed by adding the
user can change condition to both check discard and check edit redirect, restoring parity with the other content-mutating transitions:python
# After (fixed)
check discard = Conditions([
in state([constants.DRAFT], not draft error),
user can change(change permission error),
is not locked(lock error message),
])
check edit redirect = Conditions([
in state([constants.DRAFT, constants.PUBLISHED], ("Version is not in draft or published state")),
user can change(change permission error),
draft is not locked(lock draft error message),
])discard intentionally requires change permission (not delete): it is treated as undoing changes to a draft.Upgrade to
djangocms-versioning 2.6.1 or later.Workarounds
There is no configuration-only workaround. Operators who cannot upgrade immediately should restrict staff accounts to trusted users, since the missing gate reduces to
is staff under CMS PERMISSION = True.Explorabilidade
Correção
Impactos
Fornecedores
Produtos afetados
Identificadores relacionados
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾