{"id":"CVE-2026-47412","aliases":["CVE-2026-47412","GHSA-g8rr-7rj2-f627","PYSEC-2026-2934"],"related":[],"kind":"vulnerability","state":"published","title":"praisonai-platform: Any workspace member can delete the entire workspace via DELETE /workspaces/{id}","summary":"PraisonAI Platform is the platform layer for the PraisonAI multi-agent teams system. Versions prior to 0.1.4 have an authorization bypass enabling destructive action. The `DELETE /workspaces/{workspace_id}` endpoint is gated only by `require_workspace_member(workspace_id)` (default `min_role=\"member\"`). Any member of the workspace can issue a single DELETE to wipe the entire workspace, including every project, issue, comment, agent, label, and member record (cascading via the foreign-key relationships). There is no owner-role gate, no confirmation token, no soft-delete window, no recovery path. PraisonAI Platform version 0.1.4 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"PraisonAI Platform is the platform layer for the PraisonAI multi-agent teams system. Versions prior to 0.1.4 have an authorization bypass enabling destructive action. The `DELETE /workspaces/{workspace_id}` endpoint is gated only by `require_workspace_member(workspace_id)` (default `min_role=\"member\"`). Any member of the workspace can issue a single DELETE to wipe the entire workspace, including every project, issue, comment, agent, label, and member record (cascading via the foreign-key relationships). There is no owner-role gate, no confirmation token, no soft-delete window, no recovery path. PraisonAI Platform version 0.1.4 patches the issue.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n**Type:** Authorization bypass enabling destructive action. The `DELETE /workspaces/{workspace_id}` endpoint is gated only by `require_workspace_member(workspace_id)` (default `min_role=\"member\"`). Any member of the workspace can issue a single DELETE to wipe the entire workspace, including every project, issue, comment, agent, label, and member record (cascading via the foreign-key relationships). There is no owner-role gate, no confirmation token, no soft-delete window, no recovery path.\n**File:** `src/praisonai-platform/praisonai_platform/api/routes/workspaces.py`, lines 77-86; `services/workspace_service.py`'s `delete()` method.\n**Root cause:** the route uses `Depends(require_workspace_member)` which defaults to `min_role=\"member\"` and is never overridden. The service method `WorkspaceService.delete(workspace_id)` performs the destructive operation without any caller-permission verification. The role hierarchy (`MemberService.has_role`, member_service.py:80-96) is implemented but unused for this endpoint.\n\n## Affected Code\n\n**File:** `src/praisonai-platform/praisonai_platform/api/routes/workspaces.py`, lines 77-86.\n\n```python\n@router.delete(\"/{workspace_id}\", status_code=status.HTTP_204_NO_CONTENT)\nasync def delete_workspace(\n    workspace_id: str,\n    user: AuthIdentity = Depends(require_workspace_member),         # <-- BUG: defaults to min_role=\"member\"\n    session: AsyncSession = Depends(get_db),\n):\n    ws_svc = WorkspaceService(session)\n    deleted = await ws_svc.delete(workspace_id)                     # <-- destructive, no role check\n    if not deleted:\n        raise HTTPException(status_code=404, detail=\"Workspace not found\")\n```\n\n**Why it's wrong:** workspace deletion is the most destructive single action in this product — it wipes every member, project, issue, comment, agent, and label belonging to the tenant. The standard convention is to gate this on owner role, ideally with a confirmation parameter (typed workspace name) and a recovery window. This endpoint does none of that. The `require_workspace_member(min_role)` parameter exists precisely for this kind of tightening but is never invoked with anything other than the default.\n\n## Exploit Chain\n\n1. Attacker is a member of workspace `W` (joined via invite, signup default, or any other route into membership). State: attacker holds JWT with `Member(workspace_id=W, user_id=attacker, role=\"member\")`.\n2. Attacker sends `DELETE /workspaces/W` with `Authorization: Bearer <attacker_jwt>`. State: control flow enters `delete_workspace`.\n3. `require_workspace_member(W, attacker)` passes (attacker is a member, default min_role=\"member\" satisfied). `WorkspaceService.delete(W)` removes the workspace row; SQLAlchemy cascade rules drop every related row (members, projects, issues, comments, agents, labels). State: workspace `W` no longer exists.\n4. Final state: a low-privilege member has wiped the workspace. The legitimate owner has no recovery: no soft-delete, no audit-trail event for the deletion (the `Activity` log row would have been deleted too as part of the cascade). The same primitive at scale (script that DELETEs every workspace_id the attacker can enumerate) becomes a multi-tenant griefing tool.\n\n## Security Impact\n\n**Severity:** sec-high. CVSS 8.1: network attack, low complexity, low privileges, no user interaction, scope unchanged, no confidentiality (just destruction), high integrity (every workspace child row wiped), high availability (workspace gone for legitimate owner).\n**Attacker capability:** with one workspace-member token plus one DELETE request, the attacker irreversibly deletes the workspace and every child resource. The deletion is silent and immediate.\n**Preconditions:** `praisonai-platform` is deployed multi-tenant; the attacker has any membership token in the target workspace.\n**Differential:** source-inspection-verified. The asymmetry between `require_workspace_member`'s clearly-tunable `min_role` parameter and this endpoint's use of the default value confirms the gap. With the suggested fix below, member-tier tokens fail the gate at the dependency, the destructive action never reaches the service layer, and the endpoint returns 403 instead of 204.\n\n## Suggested Fix\n\n```diff\n--- a/src/praisonai-platform/praisonai_platform/api/routes/workspaces.py\n+++ b/src/praisonai-platform/praisonai_platform/api/routes/workspaces.py\n@@ -75,11 +75,15 @@\n+def _require_workspace_owner(workspace_id: str, user, session):\n+    return require_workspace_member(workspace_id, user, session, min_role=\"owner\")\n+\n @router.delete(\"/{workspace_id}\", status_code=status.HTTP_204_NO_CONTENT)\n async def delete_workspace(\n     workspace_id: str,\n-    user: AuthIdentity = Depends(require_workspace_member),\n+    user: AuthIdentity = Depends(_require_workspace_owner),\n     session: AsyncSession = Depends(get_db),\n ):\n     ws_svc = WorkspaceService(session)\n     deleted = await ws_svc.delete(workspace_id)\n     if not deleted:\n         raise HTTPException(status_code=404, detail=\"Workspace not found\")\n```\n\nDefence-in-depth: require a typed-confirmation parameter (e.g. body `{\"confirm_name\": \"<workspace_name>\"}`) and implement a 30-day soft-delete with restore. The four companion workspace-mutation endpoints (`update_workspace`, `add_member`, `update_member_role`, `remove_member`) exhibit the same default-min-role gap and are filed as their own advisories.","format":"markdown","source":"ghsa"},{"lang":"es","text":"PraisonAI Platform es la capa de plataforma para el sistema de equipos multiagente de PraisonAI. Las versiones anteriores a la 0.1.4 tienen un bypass de autorización que permite una acción destructiva. El endpoint ’DELETE /workspaces/{workspace_id}’ está protegido solo por ’require_workspace_member(workspace_id)’ (por defecto ’min_role=“member”’). Cualquier miembro del espacio de trabajo puede emitir un único DELETE para borrar todo el espacio de trabajo, incluyendo cada proyecto, incidencia, comentario, agente, etiqueta y registro de miembro (en cascada a través de las relaciones de clave externa). No hay una puerta de rol de propietario, ningún token de confirmación, ninguna ventana de eliminación suave, ningún camino de recuperación. La versión 0.1.4 de PraisonAI Platform corrige el problema.","source":"nvd"}],"published":"2026-06-01T14:24:39.000Z","modified":"2026-10-24T19:10:00.127Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"}],"cwes":["CWE-269","CWE-862"],"affected":[{"ranges":[{"version":"< 0.1.4","status":"affected"}],"vendor":"MervinPraison","product":"praisonai-platform","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.4"}],"ecosystem":"PyPI","package":"praisonai-platform","purl":"pkg:pypi/praisonai-platform","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.4"}],"ecosystem":"PyPI","package":"praisonai-platform","purl":"pkg:pypi/praisonai-platform","source":"pysec"}],"references":[{"url":"https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-g8rr-7rj2-f627","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MervinPraison/PraisonAI/pull/1686","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/MervinPraison/PraisonAI/commit/24385d64876577620f749957bd4814f162f4ca47","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/MervinPraison/PraisonAI","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/praisonai-platform","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-g8rr-7rj2-f627","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47412","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-22T18:06:08.280Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47412","url":"https://www.cve.org/CVERecord?id=CVE-2026-47412","licence":"CVE Terms of Use","modified":"2026-07-22T18:27:12.639Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g8rr-7rj2-f627","url":"https://github.com/advisories/GHSA-g8rr-7rj2-f627","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:37.177Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47412","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47412","licence":"Public domain","modified":"2026-10-24T19:10:00.127Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2934","url":"https://osv.dev/vulnerability/PYSEC-2026-2934","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:01.015Z"}],"updatedAt":"2026-11-25T22:59:29.372Z","epss":{"score":0.00284,"percentile":0.22501,"date":"2026-12-02T12:00:21.000Z"}}