This vulnerability in Kirby CMS stems from inconsistent and incorrect authorization checks within the Panel and REST API, allowing authenticated users to access information they are not supposed to see. The core of the issue lies in the failure to consistently use the isListable() permission check, which is intended to control whether pages, files, and other models appear in lists.
The analysis of the security patches reveals several key areas where these checks were missing or improperly implemented:
-
REST API Model Resolvers: The API did not filter collections of related models (like children, drafts, files, parents, siblings) based on the isListable permission. For example, when requesting a Site object, the API would return all associated children, drafts, and files, even if the user's role was configured to restrict access to some of them. This was fixed by adding .filter('isListable', true) to the respective API model resolvers.
-
Incorrect Permission Flags: In some parts of the API, the check was performed against isAccessible() instead of isListable(). The access permission is a stricter check that also controls direct access, while list is specifically for visibility in collections. This incorrect usage meant that items would appear in lists when they should have been hidden. The patch corrected this by replacing isAccessible checks with isListable.
-
Panel UI Components: The Panel, Kirby's admin interface, also suffered from similar issues. For instance, images for pages, sites, or users were displayed in lists even if the underlying file was not listable. Similarly, navigation links to the previous/next file in the file view did not respect listability permissions. The patches introduced the isListable() check in the relevant Panel components to ensure that only authorized content is displayed.
-
Direct Model Access: In some cases, direct access to models like the main Site object was not properly gated by permissions, allowing users to retrieve information about models they should not have access to. This was addressed by enforcing permission checks in the functions that retrieve these models.
By systematically adding and correcting these permission checks across the API and Panel, the patches ensure that the pages.list and files.list permissions are consistently enforced, preventing unauthorized information disclosure.