Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 1 min read

Login Is Not Tenant Isolation: Write One Negative Test

A logged-in user may still be able to request someone else's proposal by changing a URL or record ID. Caminho Solo context: This practical exercise complements Publish SaaS safely: login is not tenant isolation, with t

A logged-in user may still be able to request someone else's proposal by changing a URL or record ID.

Caminho Solo context: This practical exercise complements Publish SaaS safely: login is not tenant isolation, with the original research and fuller walkthrough.

Why this question matters

Your local prototype works. You can create a proposal and change its stage. It would be tempting to add login, hit β€œpublish,” and start accepting users. But there is a crucial difference between an application that runs and a service that can responsibly accept other people's data. The previous lesson provides a local-only lab. It must not be placed on the public internet as-is: it has no authentication or authorization, and all records share one local database.

Try the smallest experiment

Step 1. Create two fictional tenant accounts, each with its own proposal, and record ownership IDs.

Step 2. Authenticate as tenant A and attempt to read tenant B's proposal through the same route.

Step 3. Require denial regardless of client-side visibility. Repeat after a valid A-owned read to ensure the negative case is meaningful.

What to write down

Contract: user A can read A1, cannot read B1; user B can read B1, cannot read A1. Test at API and storage layers.

One failure mode to watch

Authentication proves identity, not permissions. RLS or server authorization must match the actual data model.

Primary references

How to judge your result

Keep the input, expected result and actual observation together. Check the failure case before using this workflow with real accounts or production data.

Editorial disclosure: Fully AI-generated adaptation of the published Caminho Solo English article. Examples are suggested exercises, not claims of tests actually run.

Continue with Caminho Solo: The original guide and references add the broader context for this focused example.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.