GHSA-gv23-xrm3-8c62: PraisonAI has Cross-Workspace IDOR and Privilege Escalation via Platform API
SummaryThe PraisonAI Platform API has two authorization failures that together break workspace isolation. The service layer for issues and projects performs global primary-key lookups without checking workspace ownership, so any authenticated user can read, modify, and delete resources in any workspace just by swapping UUIDs in their API requests. On top of that, every member management endpoint (add, update role, remove) only requires `min_role="member"`, which lets any workspace member promote themselves to owner and kick out the original owner. A low-privilege member of one workspace can steal data from every other workspace and take over any workspace they belong to.Both issues come from the same gap: the route layer pulls `workspace_id` from the URL and verifies membership, but the service layer ignores the workspace scope for resource lookups and ignores the caller's role level for member operations. The `require_workspace_member()` dependency does its job correctly. The problem is that the service layer doesn't use the information it provides.DetailsPart 1: Cross-Workspace IDOR (Issues and Projects)**Vulnerable Files:**`praisonai_platform/services/issue_service.py``praisonai_platform/services/project_service.py``praisonai_platform/api/routes/issues.py``praisonai_platform/api/routes/projects.py`There is a consistent split between the route layer and the service layer. Routes pull `workspace_id` from the URL and verify membership:But the service methods these routes call perform global lookups that ignore `workspace_id` entirely:**IssueService.get(), line 72:****ProjectService.get(), line 47:**Both use `session.get(Model, pk)`, which is a global lookup by primary key with no `WHERE workspace_id = ?` filter.Compare that with the properly scoped `list_for_workspace()` methods in the same files:**IssueService.list_for_workspace(), line 76:**The listing is scoped correctly. The get, update, and delete methods are not. Since `update()` and `delete()` in both services call `self.get()` internally, the workspace bypass cascades through all write operations too.**Route that discards workspace_id, issues.py line 82:****All affected operations:**| Service | Method | Line | Workspace scoped? |
|---------|--------|------|-------------------|
| IssueService | `get()` | 72 | No, uses `session.get(Issue, issue_id)` |
| IssueService | `update()` | 97 | No, calls `self.get(issue_id)` |
| IssueService | `delete()` | 150 | No, calls `self.get(issue_id)` |
| IssueService | `list_for_workspace()` | 76 | **Yes**, filters by `workspace_id` |
| ProjectService | `get()` | 47 | No, uses `session.get(Project, project_id)` |
| ProjectService | `update()` | 62 | No, calls `self.get(project_id)` |
| ProjectService | `delete()` | 88 | No, calls `self.get(project_id)` |
| ProjectService | `get_stats()` | 97 | No, only filters by `project_id` |
| ProjectService | `list_for_workspace()` | 51 | **Yes**, filters by `workspace_id` |Part 2: Workspace Takeover via Missing Role Enforcement**Vulnerable Files:**`praisonai_platform/api/routes/workspaces.py` (member management routes)`praisonai_platform/api/deps.py` (authorization dependency)`praisonai_platform/services/member_service.py` (role hierarchy implementation)The authorization dependency supports role-based access:**require_workspace_member(), deps.py line 54:**The `has_role()` method correctly implements role hierarchy:**MemberService.has_role(), member_service.py line 80:**This works correctly, but no route ever calls `require_workspace_member` with `min_role="owner"` or `min_role="admin"`. Every member management route uses the default `"member"`:**Self-promotion, workspaces.py line 115:****Owner removal, workspaces.py line 130:**Three checks are missing from `update_member_role`: self-modification, upward escalation, and modifying superiors. Two checks are missing from `remove_member`: role hierarchy and last-owner protection.PoC**Prerequisites:**A running PraisonAI Platform instance with default configurationNo special configuration required**Server setup:**Scenario: Full attack chain (IDOR + Privilege Escalation)**Step 1: Victim (CEO) creates workspace with sensitive data****Step 2: Attacker registers and creates their own workspace****Step 3: IDOR - Attacker reads victim's confidential issue through their own workspace****Observed output (HTTP 200):**The response contains the victim's `workspace_id`, which is different from the workspace in the request URL. The request was scoped to `$ATK_WS` but returned data from `$VICTIM_WS`.**Step 4: IDOR - Attacker modifies victim's issue****Observed output (HTTP 200):** Title updated across workspace boundary.**Step 5: Privilege escalation - CEO adds attacker as member (simulating invite)****Step 6: Privilege escalation - Member promotes self to owner****Observed output:**The member used their own member-level token to promote themselves to owner.**Step 7: Privilege escalation - Attacker removes original owner****Observed output:** `HTTP 204` - CEO removed from their own workspace.**Step 8: Verify - Attacker is sole owner****Observed output:**The CEO is locked out. The attacker is now the sole owner of "Executive Board" and all its data.Impact**Complete multi-tenant data breach:** Any authenticated user can read every issue and project across all workspaces by substituting resource UUIDs. The URL structure (`/workspaces/{workspace_id}/...`) implies tenant isolation but provides none.**Cross-workspace data tampering:** An attacker can modify issue titles, descriptions, statuses, assignments, and project fields across workspace boundaries.**Cross-workspace data deletion:** An attacker can delete issues and projects belonging to other workspaces.**Workspace takeover from member role:** Any member can self-promote to owner and remove all other owners, gaining sole control of the workspace and everything in it.**No recovery mechanism:** After takeover, the original owner cannot access or recover their workspace. There is no super-admin role, no audit-based rollback, and no last-owner protection.**Chain amplifies impact:** The IDOR does not require membership in the target workspace, only membership in any workspace. The privilege escalation turns that foothold into full ownership. Together, a user with a single member-level invite to any workspace can read all data platform-wide and take ownership of any workspace they are invited to.Suggested Fix**1. Scope all service get/update/delete methods to workspace_id****2. Pass workspace_id from routes to services****3. Require owner role for member management and add escalation guards**
CVSS v3.1: 8.8