Skip to content

fix: add missing authorization to the history plugin and the working version preview - #6618

Merged
gharlan merged 2 commits into
5.xfrom
fix-preview-auth
Aug 3, 2026
Merged

fix: add missing authorization to the history plugin and the working version preview#6618
gharlan merged 2 commits into
5.xfrom
fix-preview-auth

Conversation

@gharlan

@gharlan gharlan commented Aug 3, 2026

Copy link
Copy Markdown
Member

Both the history snapshots (backend and frontend preview) and the frontend preview of the working version were shown without checking whether the user may access the article and language at all.

Details are intentionally brief here — the relevant parts are only mentioned in the commit messages for now and will be described properly once released.

gharlan added 2 commits August 3, 2026 15:29
Restoring a snapshot and listing the snapshots of an article only required the `history[article_rollback]`
permission, without any check whether the user may access the target article. Any editor with that
permission could therefore roll back or enumerate the content of arbitrary articles in arbitrary languages.

The frontend preview had the same gap and rendered historic content - including content that has been
removed since - of articles the user has no permission for.
The frontend preview of the working version was only gated by `rex_backend_login::hasSession()`, which
merely looks for a user id in the session. Neither the category nor the clang permission was checked, so
any backend user - even one who may only access the media pool - could read the working version, and
therefore unpublished content, of any article in any language.

- use `createUser()` instead of `hasSession()`, so session expiry as well as the status and the password of
  the user are validated
- check the category and clang permission of the article whose slices are actually fetched
- limit the preview to the requested article, so articles embedded via `REX_ARTICLE[]` keep their live
  version instead of exposing their working version

The last point also requires skipping plain `rex_article_content_base` instances: those are used to write
the article cache, and switching them to the working version would persist unpublished content into a cache
file that is served to everybody.
@rex-bot rex-bot added the bug label Aug 3, 2026
@gharlan gharlan added this to the REDAXO 5.21.4 milestone Aug 3, 2026
@gharlan
gharlan merged commit ee2e668 into 5.x Aug 3, 2026
18 checks passed
@gharlan
gharlan deleted the fix-preview-auth branch August 3, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants