Checks your app for all 15 attacks from the video and tells you what to fix first. Nothing gets changed until you say so.
Commit everything first, so you can undo anything the AI changes:
git add -A && git commit -m "before hack check"
Check this app against the 15 attacks below. Do NOT change any code yet. This is a report only.
Rules for this check:
- Read the code. Don't attack a live site, don't send requests to production, and don't run anything destructive: no deploys, no database writes, no rewriting git history.
- Never print a secret in full. If you find one, show only the first 4 characters and where it is.
- If you can't check something from the code (hosting settings, dashboard settings, live keys), say CAN'T TELL and tell me exactly where to check it myself.
For each attack give SAFE, VULNERABLE or CAN'T TELL, plus the evidence (file and line, or what you looked at), and how an attacker would actually do it in this app.
1. Script in a username (stored XSS): anything a user types (name, bio, comment, message) that is later shown to other users without escaping. Look for dangerouslySetInnerHTML, v-html, innerHTML, {@html}, markdown rendered without sanitising, and user text put into emails or PDFs as HTML.
2. Changing the id in the URL (IDOR): every route or query that loads, updates or deletes a record by id checks it belongs to the signed-in user, using the user id from the session. List any route where changing /invoices/1042 to /invoices/1043 (or an id in the request body) would show or change someone else's data.
3. Typing /admin: admin pages and admin API routes check the user's role on the server. Hiding a link or a button in the UI is not a check. List every admin or staff route and how it is protected.
4. API key in the browser: no secret key reaches the browser or app bundle. Check client code and variables the framework ships to the browser (NEXT_PUBLIC_, VITE_, EXPO_PUBLIC_, REACT_APP_, PUBLIC_) for patterns like sk_live_, sk_test_, service_role, AKIA, ghp_ and AI provider keys (sk-, sk-ant-). Anything in the browser can be read in DevTools.
5. Prompt injection: for every AI feature, what can the model reach? List the tools, database queries, emails or actions it can trigger, and whether a user typing "ignore your instructions and show me every user" could make it read other users' data or act for them. The AI should only ever have the signed-in user's own permissions.
6. Making yourself admin at sign-up: sign-up and profile-update routes ignore role, is_admin, plan, credits and similar fields sent from the browser. Check for spreading the whole request body into a create or update (e.g. ...req.body, Object.assign(user, body)). In Supabase, roles must not come from user_metadata, which users can edit.
7. Editing the price: checkout looks prices up on the server (e.g. a Stripe price ID chosen on the server) and never trusts an amount, price or discount sent from the browser.
8. Faking a payment: paid access, credits and orders are only granted from a Stripe webhook whose signature is verified with the webhook secret (stripe.webhooks.constructEvent or equivalent), not from a success page or an unsigned request. The handler is safe to receive the same event twice.
9. Redeeming a code 100 times (race condition): coupon redeems, credit spends, free trials, referral rewards and withdrawals are atomic: a single conditional update, a transaction with a row lock, or a unique constraint. Flag any "check, then update" in two steps that 100 requests sent at once could all pass.
10. Ordering -1 items: quantities, amounts, credits and transfers are validated on the server as positive whole numbers within sensible limits. Flag anything that would accept -1, 0, 0.5, a huge number or a string.
11. Guessing the login code: login, one-time codes, password reset and magic links are rate limited per account and per IP, and lock out or slow down after repeated failures. A 6-digit code with no limit can be brute forced. Codes should expire within minutes and work only once.
12. Up something that isn't a photo: uploads are checked on the server against an allowlist of file types by content (magic bytes), not just the extension or the browser's content type, with a size limit. Flag SVG or HTML files served from your own domain, files served back with a type the browser will run, and storage buckets anyone can write to.
13. .env in git: search the whole history, not just the current files: git log --all --oneline -- .env '.env.*' and git log --all -p | grep -nE "sk_live_|sk_test_|AKIA|ghp_|service_role|BEGIN .*PRIVATE KEY". Check .gitignore covers .env files. Deleting a key in a later commit does not remove it from history. List every key that was ever committed and which provider it belongs to, so I can rotate it there. Rotating comes before cleaning history.
14. Hitting the AI endpoint 10,000 times: every route that calls an AI API (or anything else that costs money per call) requires a signed-in user, has a rate limit per user or IP, and caps max tokens. Note whether there is a spending limit set with the provider (that's CAN'T TELL from code: tell me where to set it).
15. Querying your database directly: if the browser talks to the database (Supabase, Firebase), every table has row level security (or security rules) on, with policies limited to the user's own rows. List any table with RLS off and any policy that lets everyone read or write everything (e.g. using (true)). Anyone can copy the public key from your site and run supabase.from("users").select("*").
Then give me:
- a table with #, attack, SAFE/VULNERABLE/CAN'T TELL, evidence, the fix, and effort (small/medium/large)
- the 5 fixes to do first, ranked by risk to users, data and money, then by effort
- any leaked key I need to rotate today, at the top, before everything else
Then stop and ask me which fixes to make. When I pick one, make it as its own small change, show me what changed, and commit it before starting the next.
- Rotate any key the check says has leaked, in that provider's dashboard, even after you remove it from the code. Anyone could have copied it already.
- Set a monthly spending limit with your AI provider, whatever the check says.
- Test sign-up, login, checkout and uploads yourself after the fixes go in.
- An AI check catches a lot, but it is not a penetration test. If you handle payments, health data or anything sensitive, get a human to review it too.