Security checklist for small apps
Thirty-odd checks that stop the common ways small and AI-built apps get breached, from exposed API keys and missing database rules to webhooks and prompt injection.
Most breaches of small apps are not clever. They are a secret key in browser code, a database table anyone can read, or an admin route that forgot to check who is asking. This list covers those first. Work through it before launch and after any big change.
Scanners that help are listed in Security and reputation checks.
SecretsLink to this section
- No secret API keys in frontend code. Anything the browser downloads, a visitor can read. Only publishable or “anon” keys designed to be public belong there.
.envand other secret files are listed in.gitignorebefore the first commit.- Secrets live in your host’s environment variables or secret settings.
- Any key that ever touched a public repository, a chat, a screenshot or a ticket has been rotated.
- GitHub secret scanning with push protection is on for the repository.
Database and permissionsLink to this section
- Row Level Security (or equivalent rules) is on for every table, with a policy for each action.
- Tested: logged in as user A, you cannot read, change or delete user B’s records by changing an ID.
- Every API route checks login and ownership, not just the page that calls it.
- Admin routes and dashboards need a separate role and two-step login.
- Database queries use parameters; no SQL built by joining strings with user input.
- Storage buckets are private by default; files are shared with short-lived signed links.
Inputs and outputsLink to this section
- All input is validated on the server: type, length, format, allowed values.
- User content is escaped before it is shown, so pasted HTML or scripts do not run (XSS).
- Rich text and Markdown from users go through a sanitiser that removes scripts and event handlers.
- File uploads are checked for type and size, renamed, and never executed.
- Error pages and API errors never show stack traces, queries or internal paths.
- Logs never contain passwords, tokens, card numbers or full personal data.
Sessions, requests and the browserLink to this section
- HTTPS everywhere, with HSTS on where your host allows it.
- Session cookies are
Secure,HttpOnlyandSameSite=LaxorStrict. - Requests that change data are protected against CSRF (SameSite cookies plus a token, or your framework’s built-in protection).
- CORS allows only your own domains. Never
*on endpoints that use cookies or keys. - Security headers are set: Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, and frame protection. See Security headers on static hosting.
- Sessions and tokens expire, and users can sign out everywhere.
Abuse and costLink to this section
- Login, sign-up and password reset are rate-limited.
- Endpoints that call paid services (AI, SMS, email) are rate-limited per user and per IP.
- Hard spending caps are set on AI providers, cloud accounts and SMS. See Cost control.
- Forms have spam protection that does not block real people (a honeypot field or a privacy-friendly challenge).
Third partiesLink to this section
- Webhooks from Stripe, GitHub and others verify the signature before acting.
- Every package exists and is the intended one; AI tools sometimes invent names that attackers then register.
- Dependabot or
npm auditruns regularly, and critical updates are applied within days. - Third-party scripts on your pages are few, from sources you trust, and loaded only where needed.
AI featuresLink to this section
- The model is called from the server, never with a key in the browser.
- Model output is treated as untrusted and escaped before display.
- The model cannot run tools, SQL or payments without limits and, for anything irreversible, a human confirming.
- Customer data does not go to AI tiers that train on inputs. See Adding AI features.
RecoveryLink to this section
- The database is backed up automatically and a restore has been tested.
- You know how to rotate every key in under an hour, and where each one is used.
- A
security.txtfile and a contact address let researchers report problems to you privately. - You have written down what you would do if a laptop with production access were stolen.
Questions people ask
My app is tiny. Will anyone really attack it?
Automated scanners attack everything, not just big names. They look for exposed keys in public code, open database tables, admin pages without passwords and old vulnerable packages. Small apps are easier targets, not safer ones.
An API key ended up on GitHub. I deleted the file. Am I safe?
No. The key is still in the repository history and may already have been copied by bots within minutes. Create a new key, delete the old one at the provider, then check the provider’s usage logs for anything unexpected.
Can I ask an AI tool to check my app's security?
Yes, and you should, but treat it as a first pass. Ask it to act as an attacker, go through this checklist item by item, and show you how to verify each fix yourself. Then run the free scanners listed on this page.
Tools on this page
- GitHub secret scanningFree tier, checked Oct 2026
- MDN HTTP ObservatoryFree, checked Oct 2026