Skip to content
IDOR Write-up Intermediate

The Multi-Tenancy Bug That Leaked 10,000 User Records

A new endpoint copied an existing query but omitted the tenant_id filter, so it returned records from every tenant. An authenticated user applying a certain filter in a specific UI flow could see other tenants' data.

bytemedaily Follow

Published on bytemedaily.medium.com

It was a normal weekday deploy. No late night.

Byte Me Daily, on bytemedaily.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a copy-pasted query in a new code path omitted the tenant_id filter, and tenant scoping was assumed to be enforced elsewhere rather than guaranteed.

Impact

Records from every tenant could be exposed to authenticated users in that UI flow, and the leak went unnoticed for two weeks until a customer raised a support ticket.

What the attacker needed

An authenticated account; access to the specific admin UI flow; a certain filter applied

The fix

The team made tenant scope structurally required (schema constraints, middleware rejection, query builders that refuse unscoped queries) and added database row-level security plus cross-tenant tests; the text does not say the original endpoint itself was patched.

How it was found

  1. An authenticated user reaches the new internal admin view.
  2. The user applies a certain filter in that specific UI flow.
  3. The endpoint runs the copied query without a tenant_id condition.
  4. The database returns rows from all tenants and the response is sent back.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

In a multi-tenant app, many customers share the same database tables, and each row is tagged with a tenant_id so queries only return that customer's data. Here one query forgot that tag, so it returned everyone's rows. A logged-in user could then see other customers' records in a dropdown.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.