{"id":"GHSA-5g9x-qwh5-33x4","summary":"djangocms-versioning: Authorization Bypass Through User-Controlled Key and Missing Authorization","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 — 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).\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's own permission check (`Version.has_change_permission` → `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 — 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`) — 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`.","aliases":["CVE-2026-69138"],"modified":"2026-11-18T21:30:21.173085132Z","published":"2026-11-18T21:19:04Z","database_specific":{"nvd_published_at":null,"cwe_ids":["CWE-639","CWE-862"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"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"}],"affected":[{"package":{"name":"djangocms-versioning","ecosystem":"PyPI","purl":"pkg:pypi/djangocms-versioning"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.6.1"}]}],"versions":["2.0.0","2.0.0rc1","2.0.1","2.0.2","2.1.0","2.2.0","2.2.1","2.3.0","2.3.1","2.3.2","2.4.0","2.5.0","2.5.1","2.6.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-5g9x-qwh5-33x4/GHSA-5g9x-qwh5-33x4.json","last_known_affected_version_range":"\u003c= 2.6.0"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H"}]}