Jason Woltje f40d362b46
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
fix(security): M2-008 Valkey key audit — replace KEYS with SCAN, restrict /gc to admin
Audit findings:
- mosaic:session:{sessionId}:* — session-scoped; sessionId is a UUID (not
  guessable); keys don't need userId embedded because session-ID ownership
  is enforced at the WebSocket/HTTP auth layer before any key access occurs
- mosaic:auth:poll:{token} — token is crypto.randomUUID(); userId is stored
  in the value (not the key); TTL 5 min; no enumeration risk
- sweepOrphans() accepted a _userId param but ignored it, allowing any
  authenticated user to trigger a system-wide GC sweep via /gc; fixed by
  removing the unused param and promoting /gc command scope to 'admin'
- All three KEYS calls (collect, sweepOrphans, fullCollect) replaced with a
  private scanKeys() helper using SCAN cursor iteration to avoid Valkey
  event-loop stalls under production key volumes

No key-pattern schema changes needed: session keys are already sufficiently
opaque (UUID entropy). The cross-user action risk was in /gc dispatch scope.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 15:44:27 -05:00
Description
Self-hosted multi-user AI agent platform — web dashboard, TUI, remote control, shared memory, mission orchestration
16 MiB
2026-04-08 00:42:54 +00:00
Languages
TypeScript 74.5%
Shell 19.7%
PowerShell 3%
JavaScript 1.4%
Python 1%
Other 0.4%