Web Application Security Basics: The Decisions That Matter
The defenses every web application needs regardless of what it does: input handling, output encoding, authentication, authorization, transport security and dependency hygiene.
On this page
Why does it matter?
The commonest breaches exploit well-documented, decades-old categories of mistake, which means most of the risk is addressable with known, boring measures rather than novel ones.
What are the numbers?
- Reference list the OWASP Top Ten, revised periodically
- Transport HTTPS everywhere, with HSTS once you are confident
- Injection defense parameterised queries, never string concatenation
- Cross-site scripting defense contextual output encoding, plus a Content Security Policy
- Cross-site request forgery defense anti-forgery tokens and SameSite cookies
- Dependency risk known vulnerabilities in third-party packages
What should I do?
- Parameterise every database query without exception
- Encode output for the context it lands in rather than sanitizing input once and hoping
- Check authorization on the server for every request, not just in the interface
- Keep dependencies patched and know what you are running
- Set security headers, including a Content Security Policy you have actually tested
What should I avoid?
Avoid:
- Trusting anything the client sends, including hidden fields and prices
- Rolling your own authentication or cryptography
- Leaving debug mode on in production, which prints credentials into error pages
- Treating a penetration test as a substitute for secure defaults
When should I get help?
Short answer Bring in help immediately after any suspected breach, before handling payments or special category personal data, or when dependencies have gone unpatched long enough that nobody knows what is exposed.
Where this comes from
- OWASP — Top Ten
- National Cyber Security Centre — Secure development and deployment
- MDN Web Docs — Web security
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.