Security Basics Every Web App Gets Wrong
Most breaches exploit boring, known weaknesses. The OWASP-flavored fundamentals: authentication, access control, injection, and dependency hygiene.
Real-world breaches rarely involve exotic zero-days. They involve a forgotten admin endpoint, a dependency nobody updated, an ID in a URL that nobody checked ownership on. Security for most web applications is not wizardry; it is a short list of fundamentals applied without exception.
Authentication: do not hand-roll it
Use your framework's or a reputable provider's auth rather than inventing your own. Hash passwords with bcrypt or argon2, never anything homemade or fast. Rate limit login and reset endpoints, and return identical messages for wrong-email and wrong-password, because attackers enumerate accounts through the difference. Offer multi-factor authentication, and require it for anything administrative.
Authorization: check ownership everywhere
The most common critical bug in production apps is insecure direct object reference: /orders/1234 happily serving order 1234 to whoever asks. Every request must verify not just that a user is logged in but that this user may touch this resource. Enforce it in one shared layer, not in each handler's good intentions, and write tests that try to cross tenant boundaries.
The input rules that never expire
- Parameterized queries always; string-built SQL is how injection still happens in new code.
- Escape output by default and let your template engine do it; XSS arrives wherever someone bypassed the escaping.
- Validate uploads by content, store them outside the web root, and serve them from a separate domain.
- Set the security headers, CSP, HSTS, frame-ancestors, and secure, httpOnly cookies.
Dependencies and secrets
Your app includes thousands of packages other people wrote; automated vulnerability scanning and a monthly update habit are the entire defense. Keep secrets in environment configuration or a secrets manager, never in the repository, and rotate anything that ever leaked. None of this is glamorous, which is exactly why the teams that do it consistently are rare, and rarely breached.
Services related to this content
Ready to put this into practice?
Here's where I can help you build it.
- UX/UI & HTMLRedesigns and rebrands, email design, HTML, and deployment. View service
- Nuxt / VueCustom Nuxt sites, Vue apps, and dashboards. View service
- WordPressLean, editable sites you own outright. View service
Plans bill the time tracked on a subscription, or one price on a fixed rate. Contact if this is the work you want done.
More Technology guides
From the same topic.
TechnologyWhat Cloudflare Actually Does for Your Website
TechnologyDNS Explained: The Address Book Behind Every Visit
TechnologyCDN Caching: How the Edge Makes Sites Feel Instant
TechnologyStopping Form Spam Without Punishing Humans
TechnologyManaged App Hosting: What Platforms Like Sevalla Take Off Your Plate
TechnologyDeploying an SSR App Without a DevOps Team
TechnologyA Sensible Production Stack: Cloudflare in Front, Managed Hosting Behind
TechnologyChoosing a Tech Stack Without Regret