All problems

Tenant Export Cache Returns Another Customer Data

Level 3 · node · Security · Tenant-isolation cache key error

Scenario

A multi-tenant business system briefly caches report exports to reduce repeated work. Each request passes the authenticated tenantId and reportId to the service, and the repository also scopes reads by tenant. Individual requests look correct, but a security report says that when two customers request the same reportId consecutively, the second customer can receive the first customer export content.

Requirements

- Export data is read only within the authenticated tenantId scope - Repeated requests for the same tenantId and reportId may reuse the cache - Different tenantIds must not share a cache entry even when reportId is the same - Cached data from one tenant must never appear in another tenant response - A report missing for the requested tenant returns null

Acceptance criteria

  • The first tenant report is generated from that tenant data
  • A repeated request by the same tenant returns the same export result
  • Another tenant with the same reportId receives only its own data
  • Reversing request order does not mix cached data between tenants
  • A report absent from the requested tenant returns null