How to make Claude Code attack your own app before you launch
The Tea app leaked 13,000 selfies and photo IDs from a storage bucket nobody had locked. Don’t wait for a stranger to find yours. This prompt has Claude break into your own app first, using only what a stranger would have, and tells you every way it got in.
- attack steps
- 5
- test accounts
- 2
- prompt
- 1
Run your app, then paste this
Start your app locally or on a staging URL, open Claude Code in the project folder, put your URL in the second line and paste the whole thing. It attacks, it reports, and it doesn’t touch your code until you approve a fix.
Act as an attacker trying to break into my own app before I launch it. I own this app and this repo, and you have my permission to test it.
Only attack my local or staging copy: [PASTE YOUR LOCALHOST OR STAGING URL HERE]. Never touch production data, anyone else's site, or a third-party service.
Rules: don't edit, delete, commit or deploy anything. Create at most 2 test accounts. Stop and ask me before anything that could send an email, charge money or delete data.
Step 1. Recon like a stranger. Open the site the way an outsider would. Read the JavaScript the browser downloads and list everything an attacker gets for free: API and database URLs, public keys (Supabase anon key, Firebase config), storage bucket names, hidden or admin routes, source maps.
Step 2. Attack with no account. Using only what you found in step 1, try to:
- read every table straight from the database with the public key
- list and download files from every storage bucket
- call every database function (RPC) and every API route without logging in
- open admin pages and hidden routes directly
Step 3. Attack as a normal user. Sign up as test user A and test user B. As user A, try to read, change and delete user B's data: swap IDs in URLs and requests, call the API with B's IDs, guess storage paths, and send fields the form doesn't show (role, is_admin, plan, user_id, price).
Step 4. Check the live database, not just the code. Migrations can say one thing while the real database says another. If you have database or CLI access, list every table with row level security off, every policy that is just "true", and every function the anon role or PUBLIC can execute (look hard at SECURITY DEFINER). Revoking from anon alone isn't enough if PUBLIC still has it.
Step 5. Report. For every hole you got through: what you did, the exact request or command, what came back (redact real people's data), how bad it is (critical, high, medium, low) and the fix in one line. Worst first. Then list what you tried that held.
Don't fix anything yet. Wait for me to say which ones to fix, then fix them one at a time and show me each diff.Five steps, the way a stranger would do it
- 01Recon like a strangerIt reads the JavaScript your site ships and lists the keys, URLs and buckets anyone can see.
- 02Attack with no accountIt uses your public key to read tables, list storage and call functions while logged out.
- 03Attack as a normal userIt signs up twice and tries to read and change the other account’s data.
- 04Check the live databaseIt looks at what your database actually allows, not what your migrations say.
- 05Report, worst firstEvery hole it got through, the exact request, and a one-line fix. Nothing changes until you say so.
Stuff I’d missed for months
I ran this on my own apps. The first two never showed up when I just read the code, because they lived in the live database, not the repo.
- 01Database functions anyone could runTwo of them let anyone with the public key rewrite a published blog post, no login needed.
- 02A view that skipped the row rulesIt sat over about 125,000 sessions, and the table rules didn’t apply to it.
- 03A password with a fallback in the codeIf the real one wasn’t set, the hardcoded one worked in production.
Attack just one thing
Just the storage:
List every storage bucket this app uses and try to list and download files from each one without logging in.Just the database functions:
List every database function the anon role or PUBLIC can execute and try calling each one logged out.Just one user vs another:
Sign up as two test users and try to read and change user B’s data while logged in as user A.Only attack apps you own. Point it at your own localhost or staging site, never at someone else’s, and never at production with real users in it. This catches the common holes in apps built fast with AI. It isn’t a penetration test, so if you handle payments, health data or anything regulated, get a real security review too. For the full 20-point checklist, see the security guide.