audit(installPlatformAgent): org_plugin_allowlist UNIQUE collision fails multi-root installs forever + missing FOR UPDATE + status='online' seed lie #2508

Closed
opened 2026-06-10 05:29:13 +00:00 by core-devops · 0 comments
Member

2026-06-10 audit on workspace-server/internal/handlers/platform_agent.go (the install IS correctly one tx + idempotent — these are hardening gaps):

  1. MEDIUM: org_plugin_allowlist has UNIQUE(org_id, plugin_name); with N>1 old roots allowlisting the SAME plugin, the second UPDATE…SET org_id collides 23505 → whole install fails deterministically on every retry (multi-root is in-contract input). Fix: INSERT…SELECT…ON CONFLICT DO NOTHING + DELETE leftovers.
  2. LOW: the old-roots SELECT takes no row locks (READ COMMITTED) — a root created mid-install is never re-parented → permanent two-root org. Add FOR UPDATE.
  3. LOW: the upsert seeds status='online' for a row with no container (green-dot lie until first heartbeat).

🤖 Generated with Claude Code

2026-06-10 audit on workspace-server/internal/handlers/platform_agent.go (the install IS correctly one tx + idempotent — these are hardening gaps): 1. MEDIUM: org_plugin_allowlist has UNIQUE(org_id, plugin_name); with N>1 old roots allowlisting the SAME plugin, the second UPDATE…SET org_id collides 23505 → whole install fails deterministically on every retry (multi-root is in-contract input). Fix: INSERT…SELECT…ON CONFLICT DO NOTHING + DELETE leftovers. 2. LOW: the old-roots SELECT takes no row locks (READ COMMITTED) — a root created mid-install is never re-parented → permanent two-root org. Add FOR UPDATE. 3. LOW: the upsert seeds status='online' for a row with no container (green-dot lie until first heartbeat). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2508