CASE STUDY · API SECURITY · OCTOBER 2026

Tenant Isolation Lab

A local financial API laboratory with synthetic data, automated authorization checks and correlated security events. Built as an independent portfolio project.

01

A branch number is not an organization boundary.

Two organizations share branch numbers in a synthetic financial dataset. Checking the branch alone is insufficient: a manager must only read their organization's assigned branch, while an auditor may read all branches within their own organization.

02

Verified identity, transaction-local context and RLS.

The Express API verifies the JWT and resolves organization and role from a server-side identity map. Each read uses a database transaction with local context. A restrictive PostgreSQL policy enforces organization scope, combined with role and branch rules. The application role has no superuser or BYPASSRLS privileges.

03

Own transaction: 200. Foreign transaction: 404.

The same manager can read transaction 101 in organization 1 but receives 404 for transaction 201 in organization 2. Neither the foreign record nor its data is returned. Each HTTP response is matched to its structured audit event using X-Request-ID. A 404 alone does not prove an attack; the controlled fixture identifies the foreign record.

04

A logging defect became a regression check.

Authentication rejection events were missing because the logger read the request path after mounted middleware had processed it. Capturing the original path fixed attribution. Automated checks now match fresh request IDs to the expected event, status, route and identity.

05

Evidence from repeatable checks.

6 SQL checks

Missing context, manager scope, auditor scope across both organizations, a direct foreign ID and an unknown role.

15 API checks

Allowed and denied reads, invalid authentication, parameter manipulation, JWT tampering and sequential identity changes.

6 audit checks

Fresh request IDs correlate responses with exactly one matching event, including route, status and identity fields.

40 concurrent HTTP requests

Five batches of eight requests across four identities. CI runs the suites with pool limits of one and four connections.

Both CI jobs passed for commit 4126e85 on October 4, 2026. These counts describe checks and requests, not distinct vulnerabilities.

06

Clear boundaries for the results.

Authentication uses fixed demo identities. The database credential is trusted: someone who can connect with it can change the organization context. These tests do not establish protection against stolen database credentials, SQL injection, write authorization or token revocation.

Concurrent HTTP responses are checked for isolation; simultaneous database query execution and load capacity are not measured. Audit correlation does not establish tamper-resistant logging. No production vulnerability or production readiness was established.

The separately published original API remains available. The laboratory described here runs locally and in disposable CI environments; it is not the public API deployment.