Tenant Data Isolation Review
Finds where multi tenant data leaks through caches, exports, migrations or access left after a delete or revoke.
Claude's review
8/10 Non-obvious data isolation review: bypass clients, SECURITY DEFINER, tenant-less keys, derived copies, migration defaults, stale access after revoke.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when the diff stores, caches, indexes, exports, imports, migrates, soft-deletes or revokes access-controlled or multi-tenant data - policy vs query disagreement, bypass clients, tenant-less cache and object keys, signed links, derived copies (search, cache, logs, analytics), export/restore scope, migration defaults, and stale access after delete or revoke
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: data-isolation-and-lifecycle
category: security
description: Use when the diff stores, caches, indexes, exports, imports, migrates, soft-deletes or revokes access-controlled or multi-tenant data - policy vs query disagreement, bypass clients, tenant-less cache and object keys, signed links, derived copies (search, cache, logs, analytics), export/restore scope, migration defaults, and stale access after delete or revoke
tech_stack: Web & API
source: cloudflare/security-audit-skill (MIT) data-isolation and lifecycle attack classes, adapted to diff review; own wording; OWASP Top 10:2025 A01 and CWE cited by name only
---
# Data Isolation and Lifecycle
## Overview
Endpoint checks protect one door. Data has many copies — a cache entry, a search document, a thumbnail, an export file, a log line, a backup, a queued job — and each copy has its own reader and its own retention. Isolation fails where a copy forgets who owns the data, or where a deleted or revoked record keeps working.
**Core principle:** pick one protected record the diff touches and follow it through every write, read, copy and state change. At each edge, name the code that enforces its owner. A tenant column is not that code.
## 1. A Tenant Field Is Not Isolation (CWE-639, CWE-863)
The owner column exists; the question is which query, policy or key enforces it on this path.
- **Bypass clients:** Supabase's service-role key or a Postgres role with `BYPASSRLS` used in a request handler; a "system" repository that skips the tenant filter, called from a user-facing path.
- **Unscoped escapes:** GORM `Unscoped()` (it also drops the soft-delete filter), Rails `unscoped`, a Django manager that is not the filtered default, Hibernate filters that do not apply to native queries, Prisma middleware that a raw query skips.
- **Policy and query disagree:** row-level security on the table but the new view, function (`SECURITY DEFINER`), materialized view or aggregate reads around it; a join that brings in rows of another tenant through an unscoped relation.
```sql
-- ❌ SECURITY DEFINER runs as the function's owner; a table owner bypasses RLS
-- (unless FORCE ROW LEVEL SECURITY is set), so the caller's policy never applies
CREATE FUNCTION project_stats(p uuid) RETURNS TABLE(...) LANGUAGE sql SECURITY DEFINER
AS $$ SELECT ... FROM tasks WHERE project_id = p $$;
-- ✅ SECURITY INVOKER (the default), or filter on the caller's tenant inside the function
```
## 2. Keys and Namespaces Without the Tenant
Two principals collide on one logical key even though their records have separate owners:
- cache keys built from a user-chosen name (`report:` + name) or from an id that is only unique per tenant;
- object-storage keys from the uploaded filename (`uploads/avatar.png`) — one tenant overwrites or reads another's;
- search document ids, deduplication keys, idempotency keys and lock names without the tenant;
- globally unique constraints that let one tenant squat or probe another tenant's slug, email or domain.
...From makifbaysal's repository, Apache-2.0 licence.
Related skills
-
Checked
Codebase quality audit
Audits a whole code repo for bugs, security holes, slow paths and dead code, ranked in plain English.
7/101 credit -
Checked
Security and CVE audit
Runs a security and CVE audit on code in any language and scores it out of 100, with false alarms filtered.
7/101 credit -
Checked
OWASP code review
Reviews code for security flaws using the latest OWASP Top 10 lists, including those for AI and agent apps.
7/101 credit -
Checked
Code security hardening
Hardens code that handles user input, logins and data against the OWASP Top 10, starting from a threat model.
7/101 credit -
Checked
Android intent security
Audits Android components and incoming intents to fix redirection and unauthorised access holes in your app.
8/101 credit -
Checked
GitHub Actions Security
Reviews your GitHub Actions workflows for script injection, risky triggers and over scoped tokens, with fixes.
7/101 credit