Skip to content
goodprompts

Audit a codebase for authorization and tenant isolation flaws

Produces a security review of access controls, ownership checks and role escalation, given access to the application's code and test accounts.

CodingSuggested models Any LLMby @Sujay__Raj on X

The prompt

3,017 characters
Act as a Principal Application Security Engineer specialising in authorization, role-based permissions and multi-tenant SaaS security. Audit my application's actual codebase to identify broken access controls, privilege escalation risks and opportunities for users to access data belonging to other accounts. Do not assume authentication automatically provides authorization. STEP 1: MAP EVERY ACCESS BOUNDARY -Identify all user roles, organizations, workspaces and ownership models. -Find every protected page, API route, server action and database operation. -Identify which resources are private, shared or publicly accessible. -Check where user identity and account ownership are verified. -Find operations that rely only on hidden buttons or frontend checks. -Map any privileged service-account operations. STEP 2: VERIFY RESOURCE OWNERSHIP -Check whether users can access records belonging to another account. -Inspect API parameters, URL IDs and database queries for missing ownership checks. -Review create, read, update and delete permissions separately. -Verify organization switching cannot leak records between tenants. -Inspect database Row Level Security policies where applicable. -Review file storage, downloads and signed URL permissions. STEP 3: AUDIT ROLE ESCALATION -Check whether standard users can invoke administrator operations. -Identify roles or permissions that can be changed through client-controlled input. -Review invitation, membership and ownership-transfer workflows. -Verify permissions are enforced in backend code and database policies. -Inspect caching and background tasks for cross-user data exposure. STEP 4: TEST REAL ATTACK SCENARIOS Using synthetic test accounts, test: -User A requesting User B's records. -A regular user invoking an admin endpoint. -A removed team member accessing old resources. -A user switching between organizations. -Direct API requests that bypass the frontend. -Unauthorized file downloads and bulk operations. STEP 5: CREATE A SAFE REMEDIATION PLAN -Identify every vulnerable endpoint and affected file. -Recommend server-side ownership and role checks. -Recommend database-level protections where appropriate. -Add regression tests for cross-tenant access attempts. -Distinguish exploitable vulnerabilities from unverified risks. IMPORTANT RULES: -Never test against real customer accounts without authorization. -Never weaken existing permissions to make tests pass. -Don't modify production security policies automatically. -Never treat frontend visibility as security. -Don't claim vulnerabilities are confirmed without supporting evidence. FINAL DELIVERABLE: 1. Complete authorization boundary map. 2. Role and permission matrix. 3. Confirmed access-control vulnerabilities. 4. Tenant-isolation test results. 5. Exact affected files and endpoints. 6. Recommended fixes and regression tests. 7. Severity-ranked remediation plan. For every issue, explain who could access what, why the protection fails and how to prevent it.
3,017 characters

About this prompt

Category
Coding
Suggested models
Any LLM
Published
Nov 23, 2026

Is this your post? Email [email protected] to ask us to remove this prompt.

Tags
#code-review#security-audit#access-control#multi-tenant#authorization

published by @finds

Comments

Details

Category
Coding
Suggested models
Any LLM
Published
Nov 23, 2026

Is this your post? Email [email protected] to ask us to remove this prompt.

Tags
#code-review#security-audit#access-control#multi-tenant#authorization
Published byGoodPrompts Finds@finds · 76 published
View profile

Comments

No comments yet.

More like this

Planning and building a data animation explainer as a canvas HTML fileCodingAudit third-party API integrations for reliability and failure risksCodingReview a pull request for scope creep and risksCodingDesign a system architecture for an appCoding4 blanksFrontend state audit prompt for reviewing app codeCoding