04 / 04

What risk does an application introduce if it forgets to include the tenant_id filter on a query in a shared multitenant collection?

It can cause cross-tenant data leakage

The critical risk is cross-tenant data leakage: an unfiltered vector search can return semantically similar points belonging to another customer. Similar mistakes can affect scrolls, reads, updates, or deletes. Qdrant does not automatically infer the application's business tenant and silently add a tenant filter. Tenant isolation is therefore an application-layer authorization responsibility. In production I would centralize tenant-scoped repository methods, derive tenant_id from authenticated server-side context, and add cross-tenant isolation tests. A common misconception is that indexing tenant_id provides security; the index improves filtering efficiency but does not enforce authorization.

javascript
  1. 1

    Security impact: a user can discover another tenant's content through search results even without knowing another tenant's point IDs.

  2. 2

    The safest design derives tenant_id from authenticated server-side identity or authorization claims rather than trusting a client-supplied tenant_id.

  3. 3

    Trade-off: centralized scoping adds application complexity but greatly reduces the probability of an endpoint forgetting the tenant filter.

  4. 4

    Test isolation explicitly by seeding similar vectors for multiple tenants and asserting that every tenant-scoped operation returns or modifies only authorized data.

Difficulty: 6/10
Topics: Cross-tenant leakage, Authorization, Defense in depth

Scenario Questions

0-2 years experience
  1. 1

    A customer sees a document title belonging to another account in search results. What is the first Qdrant-related check you would perform?

  2. 2

    Two tenants share one collection and a search handler has no tenant_id condition. What could the user observe?

2-5 years experience
  1. 1

    Search is filtered by tenant_id but a recent-points endpoint is not. How would you fix the design consistently?

  2. 2

    How would you write an integration test proving tenant A cannot receive tenant B's search results?

5-8 years experience
  1. 1

    A security review finds five repositories building Qdrant filters independently. How would you redesign the access layer?

  2. 2

    The API accepts tenant_id in the request body and also has authenticated organization claims. Which value should control the Qdrant filter and why?

8+ years experience
  1. 1

    Design defense in depth so Qdrant is treated as a data store rather than an authorization boundary. Include request context, repository APIs, auditing, and isolation tests.

  2. 2

    A production incident confirms cross-tenant search leakage for 20 minutes. How would you contain it, identify vulnerable query paths, and prevent recurrence?

Follow-up Questions

  • How would you enforce tenant scoping so individual API handlers cannot accidentally omit the filter?
  • What automated tests would you write to detect cross-tenant leakage before production?