# Multi-Tenant Isolation
> The guarantee that one customer (tenant, org, realm, project, region) can never read, change or disrupt another's data or compute. It fails at the app layer (a query missing `tenant_id`), at shared infrastructure (sessions, disks, GPUs), or in the provider's own control plane.
## How it works
A cross-tenant bug is usually an ordinary authz bug where the scope is the tenant boundary rather than a user. That multiplies impact: one account reaches every customer. Failure layers:
| Layer | Failure | Example |
|---|---|---|
| Query | `UPDATE … WHERE id = ?` without `AND tenant_id = ?` | Meteroid `UpdateCouponStatus` gRPC |
| Handler | operation never applies the session's tenant filter | MailWatch `quarantine_action.php` |
| Role scope | "admin anywhere" accepted for "admin here" | cross-org `PUT /api/memberships/{id}` |
| Shared state | session store / cache keyed without tenant | phpMyFAQ multisite passkey overwrite |
| Registration | outsiders can join an "internal" tenant | Supabase `/auth/v1/signup` left enabled |
| Infra reuse | storage or devices not scrubbed between tenants | Cloudflare Containers `skip_block_zeroing` |
| Control plane | provider component has rights over all tenants and can be steered | Azure API Connections, Cosmos DB |
| Trust relationships | vendor's role into every customer account | Qubole cross-account roles |
## Techniques / payloads
- **Two-tenant setup**: create tenant A and tenant B (separate orgs, not just users). Capture every request as A and replay with B's IDs in path, body, GraphQL variables *and* nested objects. Check write/delete paths, not only reads.
- **Find the tenant key the app forgot**: IDs leak cross-tenant through shares, invites, exports, notifications, GraphQL `node(id:)`.
- **Role-in-other-tenant pivot**: get invited to B with a low role, harvest your membership ID, then act on it with your admin token from A.
- **Signup bypass**: hit the auth provider directly (`POST /auth/v1/signup`), bypassing frontend domain checks. Look for fail-open "Before User Created" hooks and disabled email confirmation.
- **Supabase/PostgREST**: test what `anon` and `authenticated` can read or write per table. Call `SECURITY DEFINER` RPCs in `public` (`admin_list_users`, `get_all_stats`), which run with definer rights even when RLS on the underlying tables is correct. Edge functions using `service_role` skip RLS entirely, so they need their own ownership checks.
- **Shared-session cross-tenant**: start a flow on tenant 1 (WebAuthn `prepare()`), replay the session against tenant 2's `/api/webauthn/register` (phpMyFAQ CVE-2026-130369).
- **Control-plane traversal**: Azure ARM `DynamicInvoke` with path traversal in the connection path made the APIM backend act on *another tenant's* API Connection, reaching Key Vault and Azure SQL. After the blocklist fix, `DynamicList` and Consumption Logic Apps' `host.connection` gave the same result.
## Notable cases
- **Azure API Connections (binsec)**: five full cross-tenant compromises. ARM has rights to every connection, so steering which connection it calls equals tenant escape.
- **CosmosEscape (Wiz)**: Gremlin sandbox bypass yielded a platform-wide Cosmos master key, including access to databases backing Entra ID and Teams.
- **Cloudflare Containers**: Workers Paid account recovered residual disk blocks from previous tenants via device-mapper thin provisioning with `skip_block_zeroing`. Fixed by removing the option and retiring old disks and snapshots.
- **Qubole (in the wild)**: actor used the vendor's AWS credentials to assume customer integration roles, then ran TruffleHog and exfiltrated from S3.
- **MailWatch 1.2.26 (CVE-2026-85749, CVSS 8.1)**: any user could release or delete other domains' quarantined mail.
- **Meteroid < 2.2.0 (CVE-2026-125752)**: coupons updated by ID only. A tenant-scoped API key could disable, archive or read other tenants' coupons.
- **Cube Studio (CVE-2026-111671)**: low-priv users deleted other tenants' notebooks and inference pods via lifecycle endpoints.
- **WuzAPI ≤ 1.1.0**: `GET /chat/history?chat_jid=index` dumped other tenants' chat metadata.
- **CommCare formplayer** (cross-project form sessions, fixed with `@ValidateSessionOwner`), **Head Start TTADP** (cross-region read/write), **OpenRemote** (cross-realm MQTT disconnect over HTTP GET, missed in the CVE-2026-54641 fix).
- **GraphQL missing org check**: one mutation resolver lacked the cross-org check its siblings had, letting the researcher edit another tenant's permissions.
- **Compute isolation**: Copy Fail (CVE-2026-31431) and NvRoot (CVE-2026-47591, NVIDIA driver memory pinning) turn any shared-host or GPU tenant into root.
- **K8s namespaces as tenants**: NamespaceHound maps namespace-crossing and anonymous-access paths, extending the PEACH isolation framework.
## Defenses
- **Enforce tenancy in the data layer.** Postgres RLS applies the filter whether or not the query asks for it:
```sql
ALTER TABLE documents ENABLE ROW LEVEL SECURITY;
CREATE POLICY tenant_isolation_policy ON documents AS RESTRICTIVE FOR ALL TO authenticated
USING (tenant_id = current_setting('app.tenant_id', true));
CREATE POLICY document_owner_policy ON documents AS PERMISSIVE FOR ALL TO authenticated
USING (owner_id = current_setting('request.jwt.claim.sub', true))
WITH CHECK (owner_id = current_setting('request.jwt.claim.sub', true));
```
An agent-written `DELETE FROM documents;` then only touches the caller's rows. This is why RLS is recommended for AI-generated code, where tenant filters are routinely dropped. Caveat (Oneleet): disabled RLS was only ~25% of Supabase findings. `service_role`, `SECURITY DEFINER`, open signup and public-schema extensions account for the rest.
- Derive tenant from the authenticated session, never from a request parameter. Every write includes `tenant_id` in its `WHERE`.
- Key shared caches and session stores by tenant. Zero storage on allocation.
- Scope vendor and cross-account trust (external IDs, least-privilege integration roles) and monitor `AssumeRole` from vendor principals.
- Test with two real tenants in CI; see [[Authorization Testing Automation]].
## Related
- [[Authorization Security]]
- [[Broken Access Control]]
- [[Privilege Escalation]]
- [[Insecure Direct Object Reference]]
- [[BOLA in APIs]]
- [[GraphQL Authorization Flaws]]
- [[SSRF in Kubernetes and Containers]]
- [[Leaked Cloud Credentials]]
- [[AI Coding Assistant Risks]]
## Sources
- [[raw/binsec.no/azure-s-weakest-link-five-full-cross-tenant-compromises-12200|Azure's Weakest Link - Five Full Cross-Tenant Compromises]]
- [[raw/wiz.io/cosmosescape-taking-over-every-azure-cosmos-db-10940|CosmosEscape: Taking Over Every Azure Cosmos DB]]
- [[raw/blog.cloudflare.com/how-cloudflare-addressed-a-cross-tenant-data-exposure-vulnerability-in-12109|How Cloudflare addressed a cross-tenant data exposure vulnerability in Containers]]
- [[raw/wiz.io/trusted-by-default-qubole-cross-account-access-abused-in-the-wild-13979|Trusted by Default: Qubole Cross-Account Access Abused in the Wild]]
- [[raw/dev.to/cross-tenant-quarantine-idor-in-mailwatch-cve-2026-85749-13541|Cross-tenant quarantine IDOR in MailWatch (CVE-2026-85749)]]
- [[raw/github.com/meteroid-before-2-2-0-cross-tenant-authorization-bypass-14029|Meteroid before 2.2.0 cross-tenant authorization bypass]]
- [[raw/vuln.today/cube-studio-cve-2026-111671-cross-tenant-idor-13188|Cube Studio CVE-2026-111671 cross-tenant IDOR]]
- [[raw/github.com/wuzapi-through-1-1-0-cross-tenant-information-disclosure-14284|WuzAPI through 1.1.0 cross-tenant information disclosure]]
- [[raw/dev.to/cross-project-form-session-idor-in-commcare-formplayer-ghsa-qjg7-cgv8-14198|Cross-project form-session IDOR in CommCare formplayer (GHSA-qjg7-cgv8-3c43)]]
- [[raw/r3vpwnx.space/cross-region-idor-in-head-start-ttadp-read-and-write-another-region-s-15313|Cross-region IDOR in Head Start TTADP: read and write another region's data]]
- [[raw/github.com/openremote-cross-realm-mqtt-session-disconnect-without-authorization-15554|OpenRemote: cross-realm MQTT session disconnect without authorization]]
- [[raw/github.com/phpmyfaq-authorization-bypass-critical-14889|phpMyFAQ authorization bypass (critical)]]
- [[raw/medium.com/graphql-idor-how-a-missing-org-check-let-me-edit-another-tenant-s-perm-12440|GraphQL IDOR: How a Missing Org Check Let Me Edit Another Tenant’s Permissions]]
- [[raw/ehteshamulhaq198.medium.com/organization-takeover-via-privilege-escalation-idor-4310|Organization Takeover via Privilege Escalation (IDOR)]]
- [[raw/medium.com/why-row-level-security-is-the-safest-place-for-authorization-in-ai-bui-13146|Why Row-Level Security Is the Safest Place for Authorization in AI-Built Apps]]
- [[raw/oneleet.com/supabase-security-findings-why-rls-is-only-25-of-the-issues-14135|Supabase Security findings why RLS is only 25% of the issues]]
- [[raw/wiz.io/namespacehound-protecting-multi-tenant-k8s-clusters-9740|NamespaceHound: protecting multi-tenant K8s clusters]]
- [[raw/microsoft.com/cve-2026-31431-copy-fail-vulnerability-enables-linux-root-privilege-es-7540|CVE-2026-31431: Copy Fail vulnerability enables Linux root privilege escalation across cloud environments]]
- [[raw/stealthium.io/nvroot-cve-2026-47591-where-in-neocloud-multi-tenant-gpu-environments-14470|NvRoot (CVE-2026-47591) where in neocloud multi-tenant GPU environments, rent = root. Essentially it's a di...]]