{"id":"CVE-2026-69138","aliases":["CVE-2026-69138","GHSA-5g9x-qwh5-33x4"],"related":[],"kind":"vulnerability","state":"published","title":"djangocms-versioning: Authorization Bypass Through User-Controlled Key and Missing Authorization","summary":"djangocms-versioning is a general-purpose versioning package for django CMS 4 and later. Prior to 2.6.1, the check_discard and check_edit_redirect Conditions on djangocms_versioning.models.Version omit user_can_change, while VersionAdmin.discard_view and VersionAdmin.edit_redirect_view obtain a version by its primary key and rely on those conditions for object-level authorization. With CMS_PERMISSION set to True, the affected views are gated only by is_staff, allowing any staff user to select content without object-level change permission. With the default CMS_PERMISSION value of False, a staff user must also hold the global Django change_ permission, but that model-level permission does not enforce the intended per-object authorization, so the user can delete a draft version and its content object through discard or create an editable draft from a published version through edit_redirect even when the user cannot change that specific content object. This issue is fixed in version 2.6.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"djangocms-versioning is a general-purpose versioning package for django CMS 4 and later. Prior to 2.6.1, the check_discard and check_edit_redirect Conditions on djangocms_versioning.models.Version omit user_can_change, while VersionAdmin.discard_view and VersionAdmin.edit_redirect_view obtain a version by its primary key and rely on those conditions for object-level authorization. With CMS_PERMISSION set to True, the affected views are gated only by is_staff, allowing any staff user to select content without object-level change permission. With the default CMS_PERMISSION value of False, a staff user must also hold the global Django change_ permission, but that model-level permission does not enforce the intended per-object authorization, so the user can delete a draft version and its content object through discard or create an editable draft from a published version through edit_redirect even when the user cannot change that specific content object. This issue is fixed in version 2.6.1.","source":"cvelist"},{"lang":"en","text":"## 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_<model>` 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_<model>` 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`.","format":"markdown","source":"ghsa"}],"published":"2026-11-18T20:32:44.441Z","modified":"2026-11-19T15:17:41.930Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-639","CWE-862"],"affected":[{"ranges":[{"version":"< 2.6.1","status":"affected"}],"vendor":"django-cms","product":"djangocms-versioning","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.6.1"}],"ecosystem":"PyPI","package":"djangocms-versioning","purl":"pkg:pypi/djangocms-versioning","source":"ghsa"}],"references":[{"url":"https://github.com/django-cms/djangocms-versioning/security/advisories/GHSA-5g9x-qwh5-33x4","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/django-cms/djangocms-versioning/pull/573","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/django-cms/djangocms-versioning/commit/d8c570daa5f7805e8be51f15545fe77b24c44daf","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/django-cms/djangocms-versioning/releases/tag/2.6.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/django-cms/djangocms-versioning","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-19T15:00:50.952Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-69138","url":"https://www.cve.org/CVERecord?id=CVE-2026-69138","licence":"CVE Terms of Use","modified":"2026-11-19T15:00:58.702Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5g9x-qwh5-33x4","url":"https://github.com/advisories/GHSA-5g9x-qwh5-33x4","licence":"CC-BY-4.0","modified":"2026-11-18T21:30:21.173Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-69138","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-69138","licence":"Public domain","modified":"2026-11-19T15:17:41.930Z"}],"updatedAt":"2026-11-25T22:59:51.913Z","epss":{"score":0.00471,"percentile":0.42339,"date":"2026-12-01T12:00:22.000Z"}}