
The short answer
Most web apps are broken into through a short list of common mistakes, and a short list of habits prevents them: check permissions on every request, never trust input, keep production settings and dependencies safe, protect data with proven tools, and notice when something goes wrong. Below is a practical checklist you can run on every project, before launch and after every big change.

You do not need to be a security expert to build a safe app. You need a checklist, and the discipline to run it every time.
Why a checklist works
Security failures are rarely clever. They are usually one forgotten check in one route, one setting left on, or one outdated package. A checklist turns "I hope I remembered" into "I checked". Our checklist follows the OWASP Top 10:2025; Common web vulnerabilities, explained explains each item in depth.
Before you write code: design
- For each feature, write down who should be able to use it and what the worst abuse would be.
- Prices, totals and permissions are decided on the server, never sent by the browser.
- Anything that can be guessed (codes, passwords, sign-ins) has an attempt limit.
- Money and other important state changes are confirmed with the source of truth before you act on them.
Access control
- Every route that loads a record checks that this user may use it (policies or gates).
- Lists and searches start from the user's own records (
$request->user()->notes()). - Admin areas need a separate role check, not just "signed in".
- Hidden buttons are never the protection; the server check is.
- If your app fetches URLs users provide, only allow the hosts you expect (SSRF).
Input and output
- Every input is validated: type, length and allowed values.
- SQL uses the query builder or bindings, never glued strings (SQL injection).
- Output is escaped (
{{ }}in Blade); raw output only for HTML you produced (XSS). - Every form has
@csrf, and the CSRF exception list is empty or justified (CSRF). - Models list
$fillablefields; controllers save only validated data. - Uploads are checked for type and size, renamed, and stored outside the public folder.
Authentication and sessions
- Use a proven sign-in system (such as a Laravel starter kit), not a home-made one.
- Passwords are hashed with bcrypt or Argon2id (Hash passwords properly).
- Sign-in, password reset and one-time codes have rate limits.
- Two-step sign-in is offered, and required for admins.
- Sessions use secure, HTTP-only cookies and expire.
Data protection
- HTTPS everywhere, with HSTS once you are sure HTTPS works.
- Sensitive fields are encrypted with the framework's tools, never home-made crypto.
- Logs never contain passwords, tokens or full phone and ID numbers.
- Backups are encrypted and tested by restoring them.
Configuration
-
APP_DEBUG=falseandAPP_ENV=productionon live servers. - The web server serves only the
publicfolder. - Secrets live in environment settings, never in Git; a leaked secret is rotated at once.
- Default accounts and sample data are removed.
- Security headers are set (content security policy, frame options, referrer policy).
Dependencies
- Only well-maintained packages you actually need.
-
composer auditandnpm auditrun on every change, in your automated checks. - Lock files (
composer.lock,package-lock.json) are committed. - Updates are applied regularly, not only when something breaks.
Errors, logging and alerting
- Visitors see a friendly, generic error page; details go to your logs.
- Security events are logged: sign-ins, failures, permission and role changes.
- A person is alerted for the important events, not just a log file nobody reads.
- When a check errors, the request is denied ("fail closed").
- Related database changes are wrapped in transactions.
Testing
- Each security rule has a test: a user cannot open another user's record, a guest is redirected, bad input is rejected.
- Before launch, review the checklist with someone who did not write the code.
Ask your AI assistant
Here is my project's list of features and routes: [paste them]. Using the OWASP Top 10:2025, ask me one question at a time about how each feature is protected, then give me a prioritised list of what to check or fix first.
Where to learn more (trusted sources)
- The OWASP Top 10 and the OWASP Cheat Sheet Series: free, practical, kept up to date by the security community.
- Your framework's own security documentation (for Laravel: authorisation, validation, CSRF, hashing and encryption pages).
- MDN Web Docs for browser security (HTTPS, cookies, content security policy).
Practise safely
Build the deliberately unsafe app in Secure a Laravel app and fix it yourself. Only test apps you own, or practice labs built for learning: testing someone else's system without written permission is illegal.
Key takeaways
- Most breaches come from a short list of common mistakes.
- Run this checklist before launch and after big changes.
- Let the framework protect you, and never bypass its defaults without a strong reason.
- Every rule deserves a test, so it stays true.
Want a security review of your app before launch? Book a one-to-one session.
Check your understanding

Every lesson stays free. Tap the thumbs up so we know what works, or say thanks with a soda or a coffee: it pays for hosting and new lessons.




