Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

[CRITICAL] C1: MCP write-handlers bypass per-Application RBAC entirely #155

Description

@rubenvdlinde

Severity: CRITICAL

Location: lib/Mcp/Handler/CreateAppHandler.php:57, UpsertSchemaHandler.php:49, UpsertPageHandler.php:51, AddWidgetHandler.php:48, UpsertMenuItemHandler.php:50, PromoteVersionHandler.php:52

Description:
Every MCP write-handler calls only requireAuthenticatedUser() and performs no per-Application RBAC check. Any authenticated Nextcloud user can call openbuilt.upsertPage, openbuilt.upsertMenuItem, openbuilt.addWidget, openbuilt.upsertSchema, or openbuilt.promoteVersion against any virtual app — including apps where they hold no owners/editors role and are not an NC admin.

Scenario:

  1. User A owns my-app. User B has no role on it.
  2. User B calls openbuilt.upsertPage with appSlug: "my-app" and any pageId.
  3. The handler passes requireAuthenticatedUser(), proceeds to mutate my-app's manifest without checking User B's role.
  4. User B successfully overwrites or injects pages/menus/widgets into an app they do not own.

Contrast with controllers:

  • ApplicationVersionsController::update (line 291) calls requireRole(slug, WRITE_ROLES).
  • VersionPromotionController::promote (line 146) calls assertEditorOrOwner — NC admins are NOT auto-granted per REQ-OBVP-007.

The MCP path defeats both gates entirely.

Suggested fix:

  • Extract the per-Application RBAC check (owners/editors lookup) into a shared service used by both controllers and MCP handlers.
  • Each write-handler must invoke this check against the target appSlug before any mutation.
  • promoteVersion should be owners-only (no NC-admin auto-grant, consistent with REQ-OBVP-007).

Source: deep team-reviewer pass 2026-05-27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions