GHSA-5G9X-QWH5-33X4
Vulnerability from github – Published: 2026-11-18 21:19 – Updated: 2026-11-18 21:19Summary
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:
# 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:
# 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.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.6.0"
},
"package": {
"ecosystem": "PyPI",
"name": "djangocms-versioning"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.6.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-69138"
],
"database_specific": {
"cwe_ids": [
"CWE-639",
"CWE-862"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-18T21:19:04Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe `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 \u2014 and thereby the underlying content object \u2014 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).\n\n## Details\n\nVersion 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\u0027s own permission check (`Version.has_change_permission` \u2192 `content.has_change_permission` / `has_placeholder_change_permission`, with a final fallback to the Django `change_\u003cmodel\u003e` permission).\n\nTwo conditions were missing that check:\n\n```python\n# Before (vulnerable)\ncheck_discard = Conditions([\n in_state([constants.DRAFT], not_draft_error),\n is_not_locked(lock_error_message),\n])\ncheck_edit_redirect = Conditions([\n in_state([constants.DRAFT, constants.PUBLISHED], _(\"Version is not in draft or published state\")),\n draft_is_not_locked(lock_draft_error_message),\n])\n```\n\nThe corresponding admin views authorize **only** through these conditions:\n\n* `VersionAdmin.discard_view` / `VersionAdmin.edit_redirect_view` fetch the target with the stock `ModelAdmin.get_object`, which is backed by the **unfiltered** default queryset \u2014 no per-user or per-grouper scoping.\n* The views are registered with `admin_site.admin_view`, which enforces only `is_staff`.\n* `discard_view` deletes the version directly via `version.delete()` and never consults `VersionAdmin.has_delete_permission` (which otherwise delegates to the content admin and honors `ALLOW_DELETING_VERSIONS`).\n\nBecause 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.\n\n## Impact\n\n* **Type:** Broken access control / missing authorization (IDOR).\n* **Who is affected:** Multi-editor deployments where staff users hold differentiated per-object permissions.\n * Under `CMS_PERMISSION = True`, authorization for these two operations was effectively reduced to `is_staff`, so any staff user could discard or edit-redirect any version.\n * Under the default `CMS_PERMISSION = False`, it degrades to the global `change_\u003cmodel\u003e` permission (e.g. `cms.change_page`) \u2014 weaker than the intended per-object check, but not absent.\n* **Consequence:** Unauthorized deletion of draft versions and their content objects (integrity/availability of content), and unauthorized creation of drafts from published content.\n\n## Patches\n\nFixed by adding the `user_can_change` condition to both `check_discard` and `check_edit_redirect`, restoring parity with the other content-mutating transitions:\n\n```python\n# After (fixed)\ncheck_discard = Conditions([\n in_state([constants.DRAFT], not_draft_error),\n user_can_change(change_permission_error),\n is_not_locked(lock_error_message),\n])\ncheck_edit_redirect = Conditions([\n in_state([constants.DRAFT, constants.PUBLISHED], _(\"Version is not in draft or published state\")),\n user_can_change(change_permission_error),\n draft_is_not_locked(lock_draft_error_message),\n])\n```\n\n`discard` intentionally requires **change** permission (not delete): it is treated as undoing changes to a draft.\n\nUpgrade to `djangocms-versioning` `2.6.1` or later.\n\n## Workarounds\n\nThere 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`.",
"id": "GHSA-5g9x-qwh5-33x4",
"modified": "2026-11-18T21:19:05Z",
"published": "2026-11-18T21:19:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/django-cms/djangocms-versioning/security/advisories/GHSA-5g9x-qwh5-33x4"
},
{
"type": "WEB",
"url": "https://github.com/django-cms/djangocms-versioning/pull/573"
},
{
"type": "WEB",
"url": "https://github.com/django-cms/djangocms-versioning/commit/d8c570daa5f7805e8be51f15545fe77b24c44daf"
},
{
"type": "PACKAGE",
"url": "https://github.com/django-cms/djangocms-versioning"
},
{
"type": "WEB",
"url": "https://github.com/django-cms/djangocms-versioning/releases/tag/2.6.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "djangocms-versioning: Authorization Bypass Through User-Controlled Key and Missing Authorization"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.