Skip to content

FM-001 — Cross-Organization Cache Pollution

SEV-1 multi-tenancy data leak — React Query cache key missing organizationId allowed cross-tenant data to surface after workspace switch.

FieldValue
SeveritySEV-1 (cross-tenant data exposure)
CategoryMulti-Tenancy Data Leaks
Status🟢 Archived (resolved, guards in place)

Blameless rule applies. This document is about systems.

Users see data from another organization after switching workspaces.

React Query cache key did not include organizationId. Cache from org A persisted when viewing org B.

Always include currentOrganization?.id in query keys. Add enabled: !!currentOrganization?.id to prevent fetches during org switch.

// ❌ BUG PATTERN
queryKey: ['/api/contacts']
// ✅ FIX
queryKey: ['/api/contacts', currentOrganization?.id]
  • The pattern-registry.mdc React Query Pattern enforces this. Code review must verify org ID in all query keys.
  • Query key convention documented in CLAUDE.md rule 5.