The vulnerability, identified as GHSA-qqfq-7cpp-hcqj, stems from improper privilege management within Contao's back end. The core of the issue is that the system failed to consistently check for permissions related to page types when users performed actions on pages and articles. This allowed a logged-in back end user to potentially edit fields of pages and articles even if they did not have the explicit permissions for that specific page type.
The analysis of the patch commit 80ee7db12d55ad979d9b1b180f273d4e2668851f reveals several key changes made to address this flaw:
-
Missing Page Type Checks: The primary vulnerability was the absence of checks against ContaoCorePermissions::USER_CAN_ACCESS_PAGE_TYPE in critical security voters. The ArticleContentVoter::hasAccessToRecord function, for example, would grant access to an article's content without verifying if the user was allowed to interact with the parent page's type. The patch rectifies this by adding this check, ensuring that article modifications are governed by the parent page's type permissions.
-
Insufficient Permission Checks in Page Operations: The PagePermissionVoter was updated to incorporate page type checks for create and delete operations. Previously, a user's ability to create or delete a page was not restricted by the page type, leading to potential privilege escalation. The patched functions canCreate and canDelete now correctly enforce these permissions.
-
Logical Flaw in Update Check: A subtle but significant bug was fixed in PagePermissionVoter::canUpdate. The use of array_diff instead of array_diff_assoc created a loophole where certain modifications to a page's data would not be detected as changes, thereby bypassing the permission checks required for an update action. This could allow unauthorized edits to go through unchallenged.
The vulnerable functions identified are central to the authorization process for content and page management in Contao. An attacker exploiting this vulnerability would need to be an authenticated back end user. By manipulating requests to edit pages or articles, they could modify content that their assigned permissions should have restricted, leading to unauthorized information disclosure or content tampering.